Tuesday, 7 November 2017

Google Sheets v4 API calls using Node.js and the result is inconsistent

I'm trying to extract a short data from Google Sheet, the flow is as follow;Authorizing the user (access type: offline)Storing/caching the token per the oAuth2 flow.Loading the cached token and use it to extract the data.But once I uploaded on the server, the returned result become inconsistent.I don't know what causing it because most of the time it returns the right data, and it works perfectly on my local.Error Message;Google sheet API read: Error: The request is missing a valid API key. Server Information: Google App Engine, trial version;runtime: nodejs env: flex The node.js code is below;getUser(id) { this.sheets.spreadsheets.values.get({ auth: this.oauth2Client, spreadsheetId: id, range: 'Sheet1!A1:E' }, (err, response) => { if(err) { this.reject({ status: 0, message: "Google sheet API read: " + err }); return; } // The rest is omitted. }) } You can try the test file request here;http://ift.tt/2lYFyDT

Submitted November 07, 2017 at 12:41PM by premiumfriday

No comments:

Post a Comment