bassarisse / google-spreadsheet-to-json

Simple tool to export Google Spreadsheets to JSON files, though Node API or CLI
The Unlicense
134 stars 33 forks source link

403 error accessing private spreadsheet #19

Closed danieleguido closed 6 years ago

danieleguido commented 6 years ago

Hi @bassarisse ,

I receive an Unhandled rejection Error: Error: HTTP error 403 (Forbidden) when downloading data from a private spreadsheet using the json credentials:

gsjson <private gid> data.json -s cred.json 

I use the (new?) google service account to produce the credentials; Google Drive API and Google Sheets API are enabled. Is this 403 related to a missing scope? Or is it due to recent changes in the API? Or is it just an error/misconfiguration on my side?

Note that I am able to get the correct json data using gsjson with authtoken.

Thanks!

vahalla5 commented 6 years ago

Hi,

I am also having issues with this. Have tried a myriad of options with no joy. The Google API I use succesfully elsewhere doesn't work here when placed in many options ie. root/folders etc

Tried gsjson -s cred.json and also the json name given from google all with issues. Also gsjson -s credentials: cred.json (with and without quotes too) in Node

Love this software, but this is proving tricky on a much needed option for a future project

danieleguido commented 6 years ago

Hi @vahalla5, the 403 error was my fault, I forgot to add the google service account email to the list of users of my private spreadsheet (like one would do for "real" users). Then I was able to access my private spreadsheet in a bunch of ms. Are you getting the 403 error or some other error?

bassarisse commented 6 years ago

Sorry for the delay in responding =/

@danieleguido thanks for the follow-up!

@vahalla5 if you're still interested in resolving this, please open a new issue and detail your problem as much as possible, I'll gladly help in any way I can.