My application accesses private Google spreadsheet documents on behalf of an authorized user. It looks like the Google API expects developers to first request a list of all spreadsheet documents available to an authorized user before they can access certain spreadsheet keys. I wanted to find a workaround for this and, ultimately, extracting the parameter value keyfrom the URLs of the URLs that look like this:
https://docs.google.com/spreadsheet/ccc?key={some long key here}&usp=drive_web#gid=0
It was simple enough to break the string into a point where I could easily get the value keywithout the need for regular expression.
Recently, although I don’t know how recently, I see the URLs of the newly created Google Drive spreadsheets in this form:
https://docs.google.com/spreadsheets/d/{some long key here}/edit#gid=0
I was also able to extract the key from this string of URLs, but I'm just curious to know the difference between the two URLs:
- What is the meaning between two urls.
- Why does the Google API force developers to first get a list of all available documents, when a developer may just want to extract the key from a direct URL into a Google Drive spreadsheet document.
Thank!
source
share