【发布时间】:2016-06-13 23:00:58
【问题描述】:
当我尝试发出下载请求时,我的 ruby 代码遇到了每日限制问题。这是一个测试程序,所以我在终端中运行它。我只是调用 ruby 文件。
我已经关注this guide 快速进入 Google Drive API。我的代码与该指南非常相似,除了我的范围是:
SCOPE = ["https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.appfolder", "https://www.googleapis.com/auth/drive.metadata"]
我使用的凭据是选择了“其他”的 oAuth 服务密钥。
这是进行调用的代码行。
content = HTTP.get('https://www.googleapis.com/drive/v3/files/' + file_id + "?alt=media").body
这是我从 HTTP 调用中得到的错误。
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
}
我已关注this link 并创建了所有必要的凭据以使其正常工作,但仍然没有成功。我的项目中也启用了 Google Drive API。
即使在您设置了 Google API 项目及其凭据之后,如何解决此错误?
编辑:想指出我有搜索和上传使用相同的代码。下载是唯一给我错误的。
【问题讨论】:
-
是否弹出并请求身份验证?
-
否,因为已经建立了身份验证。当我把它放到控制台时,它只是把那个错误发回给我。
标签: ruby-on-rails ruby google-api google-drive-api google-api-ruby-client