My aim is to retrieve CellFeeds from Google spreadsheet URLs without authentication. I tried it with the following spreadsheet URL (published to web): https://docs.google.com/spreadsheet/ccc?key=0AvNWoDP9TASIdERsbFRnNXdsN2x4MXMxUmlyY0g3VUE&usp=sharing
This URL is stored in variable "spreadsheetName".
First attempt was to take the whole URL as argument for Service.getFeed().
url = new URL(spreadsheetName);
WorksheetFeed feed = service.getFeed(url, WorksheetFeed.class);
But then I ran into following exception :
com.google.gdata.util.RedirectRequiredException: Found
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
Second attempt was to build the URL with the key from the origin URL, using FeedURLFactory:
String key = spreadsheetName.split("key=")[1].substring(0, 44);
url = FeedURLFactory.getDefault().getCellFeedUrl(key,
worksheetName, "public", "basic");
WorksheetFeed feed = service.getFeed(url, WorksheetFeed.class);
...and I got the next exception:
com.google.gdata.util.InvalidEntryException: Bad Request
Invalid query parameter value for grid-id.
Do you have any ideas what I did wrong or is there anybody who successfully retrieved data from spreadsheet URLs without authentication? Thx in advance!