asimlqt / php-google-spreadsheet-client

A PHP library for accessing and manipulating Google Spreadsheets
Other
543 stars 154 forks source link

Edit publicly shared spreadsheets #77

Closed mattimatti closed 9 years ago

mattimatti commented 9 years ago

Hello I'm trying to figure out how to edit publicly shared spreadsheets.

https://docs.google.com/spreadsheets/d/1I02bVK66ayVUKIzfHzEns2u0S-QozCEbCEPADrf1FJA/edit#gid=0

Is this possible with your library? Your authentication defaults to oauth.

    $serviceRequest = new Google\Spreadsheet\DefaultServiceRequest($accessToken);
    Google\Spreadsheet\ServiceRequestFactory::setInstance($serviceRequest);

But in my case i don't want the users to deal with access tokens.

Form the google docs i see that i could be able to access public data even with "Public API access"

https://developers.google.com/console/help/new/?hl=en_US#usingkeys

Use an API key when your application is running on a server and accessing one of the following kinds > of data:

Data that the data owner has identified as public, such as a public calendar or blog. Data that is owned by a Google service such as Google Maps or Google Translate. (Access limitations > may apply.)

Should I implement another class implementing your ServiceRequestInterface ?

Thank you in advance!

mattimatti commented 9 years ago

I've resolved setting up a "Service account"

lucascampelo commented 8 years ago

Can you explain who do it, @mattimatti ? I'm realy interested to retreaving and update a public shared spreadsheet but your comment hasn't so clear to me.

tag commented 5 years ago

I am also curious about how to do read public sheets with just an API Key. I'm not finding it in the project the documentation.

(Editing public sheets currently requires OAuth)