views:

166

answers:

2

So I'm working on a google gadget(really only gadgetizing so I can get a datastore for this) that I want to be embeddable in a google spreadsheet (after this point, I'm going to skip the word google - you can just imagine it's there).

I want to use the spreadsheet that I embed the gadget in as a key/value store for the data I enter within the gadget (I think the 2K limit for gadget data won't be enough). It looks like what I'll want to do is use the gadget's feed api to manipulate the spreadsheet's list feed. However, in order to know what the spreadsheet's list feed is, I need to know the key for the spreadsheet (which is in the URL). I don't think I can scrape the key directly from the URL, since the gadget seems to be inserted via iframe.

So I need to know how I can tell a gadget that I'm embedding in a spreadsheet the key for that spreadsheet. I suppose I could have the user enter it manually, but I'd much rather have my gadget know the key programmatically.

A: 

You should be able to retrieve a list of spreadsheets by making a GET request to this URL:

https://spreadsheets.google.com/feeds/spreadsheets/private/full

See Google Spreadsheets API for more details: http://code.google.com/apis/spreadsheets/data/3.0/developers_guide_protocol.html#ListingSpreadsheets

JochenJung
Ok, buy how can I *programmatically* figure out which of those I'm embedded in? Or is presenting a list if spreadsheets to the user the best I can do?
rampion
Does this help: http://code.google.com/googleapps/appsscript/class_spreadsheet.html#getIdBrowser.msgBox(SpreadsheetApp.getActiveSpreadsheet().getId());
JochenJung