I'm trying to read the document from the cron:
https://sheets.googleapis.com/v4/spreadsheets/<sheet_id>?key=<api_key>
My document is available to anyone with the link.
My #1 key settings:
Application restrictions:
- IP addresses (web servers, cron jobs, etc.) - I added my external IP address.
- API restrictions - none
My #2 key settings:
Application restrictions:
- IP addresses (web servers, cron jobs, etc.) - I added my external IP address.
- API restrictions - Google Sheets API
My #3 key settings:
Application restrictions:
- IP addresses (web servers, cron jobs, etc.) - I added my external IP address.
- API restrictions - Google Sheets API, Google Drive API
My #4 key settings:
Application restrictions:
- IP addresses (web servers, cron jobs, etc.) - none
- API restrictions - Google Sheets API
My #5 key settings:
Application restrictions:
- IP addresses (web servers, cron jobs, etc.) - none
- API restrictions - Google Sheets API, Google Drive API
My #6 key settings:
Application restrictions:
- IP addresses (web servers, cron jobs, etc.) - none
- API restrictions - none
When I try to open a document with each key, I get a 403 error:
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}
The same error occurs when using the API Explorer (https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/get).
At the same time, the document itself opens successfully from a link from any computer and from any browser even to unauthorized users.
This problem began on July 9 at 09:35 PM (UTC+0).
Prior to this error, I successfully received data from the document using the #1 key settings
.
Update:
I found another strange nuance: on all other documents there is no such problem. An error is observed on one particular document. I compared the access settings with others - they are identical.
Update 2:
I tried to copy the table and open it via API - the error was the same. An hour later I tried again - it all worked.