I've read google spreadsheet documentation https://developers.google.com/sheets/api/guides/authorizing And it says, that if document is public, you don't need Oauth 2.0 and API key is sufficient. I'm trying to do a test request with hurl and api key as parameter.it, but it still gives me error, that I need to use Oauth, any thoughts?
POST https://sheets.googleapis.com/v4/spreadsheets/16woR-nfy6KYBbkQpC2YOT1GzIean8rTzjueUnlzLMiE/values/Sheet1!A1:E1:append?valueInputOption=USER_ENTERED
Response:
"error": {"code": 401,"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status": "UNAUTHENTICATED"}
You could use the format as below:
https://docs.google.com/spreadsheets/d/{sheetID}/export?format=csv
Make a URLConnection to this URL, after replacing the sheetID with your public sheet and read the csv file as you would normally do in your programming language of choice.
Please note that this is only true for Readable Public Google spreadsheets, and is a bit of a hack when you don't necessarily need to do the Credentials jig and jive
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With