1
votes

I'm using Google Query and Google Apps Script to create information pages (draw tables, graphics etc) inside Google Drive.

Since yesterday all pages, that I've created, are falling down with this message:

Error in query: ACCESS_DENIED. This spreadsheet is not publicly viewable and requires an OAuth credential.

I understand that Google wants me to use oAuth 2.0 however I'm unsure how to do this since every page is enabled only for registered Google users and of course it requires basic Google authentication.

Does anyone have any ideas on how to include oAuth 2.0 into Script inside Google Drive, which is already using oAuth 2.0 (At least I guess it is)?

2
Please add more details. Reference minimal reproducible example. - Rubén

2 Answers

0
votes

There are a number of ways of using OAuth 2.0 within Google Apps Script depending on what you're trying to achieve. See here and here, for examples.

Perhaps you could post your sample code, explaining what you're looking to do and where it is going wrong?

0
votes

We had this problem couple of days ago. We created an add-on which helped us resolve the following problem. Please go through this link to create an add-on

Then gapi js was able to communicate with our spreadsheet even when private. Hope it helps.