简体   繁体   中英

Google Sheets API Node Client Library Minimal Example

I am trying to follow this guide, however although I am the owner of a GCP project, I cannot click the button in Step 1, because that behaviour has been disabled by my employer. There are no alternative instructions to follow in this case. I have tried to assume what actions the button would have taken as: enable the Google Sheets API, then create and download client credentials and save as credentials.json .

However on line 43 of the code given in step 3 credentials.installed is called, however the client credentials I created for my GCP project has no "installed" key. I would like detailed instructions of how to create the correct credentials.json file.

This is what a credentials.json file needs to look like:

{"installed":{"client_id":"XXX","project_id":"XXX","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"XXX","redirect_uris":["urn:ietf:wg:oauth:2.0:oob","http://localhost"]}}

Please replace the XXX for the client_id , project_id and Client secret with your data.

If you are able to access the API console , you should be able to retrieve those credentials there, otherwise ask you Admin to do it for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM