Closed MarkMaldaba closed 8 years ago
Hi Mark,
Thanks for the PR. I checked this out and unfortunately there's some issues with it, If you can resolve them then I can merge it in.
Thanks Asim
Hi @asimlqt, thanks for your feedback! I will try and improve this PR to an acceptable standard.
Re: your points:
-- Mark
Hi Mark,
re:1 - Yes you're right, it won't be that easy to bypass the DefaultServiceRequest class however using the spreadsheet id place of the access token in the constructor is confusing. Maybe we should update the class to support a "visibility" property and make the constructor params optional. I'll have a think on it and see what the best way of supporting it is.
I agree it is a little confusing, but that might just be a variable naming issue. You have a think and let me know how you want me to proceed (or, if you have a strong idea and just want to dive in and make the changes yourself, then please go ahead!) :-)
I'll wait to hear back from you.
I have added accessing public spreadsheet support in v3.
These are spreadsheets that have been published using the "Publish to the web" feature (not to be confused with those that have been made public using the "Public on the web" visibility option).
The ServiceRequest should be initialised with the sheet's key as its $accessToken, and $tokenType should be set to "basic". You can then use the PublicSpreadsheetService to access the sheet.
Example:
I have exposed the $accessToken in the DefaultServiceRequest class, via a new getAccessToken() method, so that this can be accessed from the PublicSpreadsheetService class.
The new PublicSpreadsheetService class is based on SpreadsheetService, but does not implement the getSpreadsheetById() method, as this is not possible and makes no sense in the context of a public sheet. There seemed little point extending from the SpreadsheetService class, as the code is not sufficiently re-usable between the two contexts.