Google spreadsheet api Request had insufficient authentication scopes
Solution 1:
Firstly delete the credentials files
~/.credentials/sheets.googleapis.com-nodejs-quickstart.json
(depending on your setting)Change the scope variable used for reading cells from Google Spreadsheets from
var SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly'];
to
var SCOPES = ['https://www.googleapis.com/auth/spreadsheets'];
- After the execution of code, API will authenticate again and then the issue will be resolved.
Solution 2:
The scopes look good, maybe you should try to remove the credentials stored previously in /Users/yourUserName/.credentials/sheets.googleapis.com-projectName/*
, and then execute the application again to get new credentials.