尝试使用以下方式获取 Google 云端硬盘文件时出现错误:
file = service.files().get(fileId=<googleDriveFileId>).execute()
错误是:
<HttpError 404 when requesting https://www.googleapis.com/drive/v2/files/0B6Cpn8NXwgGPQjB6ZlRjb21ZdXc?alt=json returned "File not found: 0B6Cpn8NXwgGPQjB6ZlRjb21ZdXc">
但是,当我像这样直接在浏览器中复制并粘贴该链接时: https ://www.googleapis.com/drive/v2/files/0B6Cpn8NXwgGPQjB6ZlRjb21ZdXc?alt=json
我得到一个不同的错误:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit Exceeded. Please sign up",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit Exceeded. Please sign up"
}
}
我什至没有超过每日限制,控制台显示使用率为 0%。我知道 fileId 是正确的,我正在使用 Google Picker 来获取 fileId。有任何想法吗?