Hello,
I couldn't find a single example that illustrates this, or any
documentation that explains it. I simply want to read the contents of some
cells, but from a public spreadsheet without setting user credentials. All
examples and write-ups I see involve authorizing a SpreadsheetsService for
a particular user, and then fetching a list of spreadsheets from the user,
like this:
// Instantiate a SpreadsheetQuery object to retrieve spreadsheets.
SpreadsheetQuery query = new SpreadsheetQuery();
// Make a request to the API and get all spreadsheets.
SpreadsheetFeed feed = service.Query(query);
For one, the call "service.Query(query)" seems to take like 10 seconds to
return. Secondly, I'd prefer to grab any public spreadsheet in general,
not one tied to my account, and especially not a huge collection of
spreadsheets. Ideally, I just want to grab a single public spreadsheet
from its URL, and read in some cell contents as strings.
I've made a public spreadsheet and then published it (located here:
https://docs.google.com/spreadsheet/ccc?key=0AochdJZhbxmMdG1fRGlmaFpZVlBPSXBHX2hkRWxXRlE#gid=0),
and I've attempted to query this spreadsheet without calling
setUserCredentials on the SpreadsheetsService, but I can't get it to work:
SpreadsheetsService service = new SpreadsheetsService("test");
SpreadsheetQuery query = new
SpreadsheetQuery("https://spreadsheets.google.com/feeds/worksheets/0AochdJZhbxmMdG1fRGlmaFpZVlBPSXBHX2hkRWxXRlE/public/full");
SpreadsheetFeed feed = service.Query(query);
In this example, I've attempted to use the URL format described here:
https://developers.google.com/google-apps/spreadsheets/#spreadsheets_api_urls_visibilities_and_projections,
but calling service.Query(query) again takes like 10 seconds, and it
returns null. I've tried it with the standard URL as well, and a few other
variations. What am I doing wrong?
Best regards,
Russell
--
You received this message because you are subscribed to the Google Groups
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.