Google表格API:来电者没有权限

我正在尝试从cron中读取文档:

https://sheets.googleapis.com/v4/spreadsheets/<sheet_id>?key=<api_key>

任何有链接的人都可以使用我的文档 .


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

当我尝试用每个键打开文档时,我收到403错误:

{
  "error": {
    "code": 403,
    "message": "The caller does not have permission",
    "status": "PERMISSION_DENIED"
  }
}

使用API Explorer(https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/get)时会发生同样的错误 .

同时,文档本身可以从任何计算机和任何浏览器的链接成功打开,甚至可以打开未经授权的用户 .

此问题始于7月9日晚上9:35(UTC 0) .

在此错误之前,我使用 #1 key settings 成功从文档中接收了数据 .

Update:

我发现了另一个奇怪的细微差别:在所有其他文件中没有这样的问题 . 在一个特定文档上观察到错误 . 我将访问设置与其他设置进行了比较 - 它们完全相同 .

Update 2:

我试图复制表并通过API打开它 - 错误是一样的 . 一小时后我再次尝试 - 一切都奏效了 .

回答(0)