3

我在使用 Ruby 使用 Google Drive 时遇到问题。

我可以创建一个 OAuth2 客户端并开始进行经过身份验证的调用。

我必须先查询 Google 文档列表才能获取文件列表,一旦我有了文件 ID,我就会尝试像这样查询 Google Drive API:

GET https://www.googleapis.com/drive/v1/files/0B9N873iFyYR7MkRfeTAxxxxxxx?access_token=ya29.AHES6ZRckKZ2jZfC6risUtH9ZZxxxxxxxxx

但是我得到了这个:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "appNotInstalled",
    "message": "The authenticated user has not installed the app with client id xxxxx.apps.googleusercontent.com"
   }
  ],
  "code": 403,
  "message": "The authenticated user has not installed the app with client id xxxxx.apps.googleusercontent.com"
 }
}

此客户端 ID 指的是我通过 Google API Dashboard 创建的应用程序,而不是 Chrome 网上应用店。

无论如何,我尝试设置一个托管的 Chrome Web 应用程序,配置(并支付)所有内容以允许测试用户列表,但我仍然收到相同的错误消息,尽管该应用程序是从市场上正确安装的(不是本地副本)。

使用相同的客户端和凭据,我可以调用https://docs.google.com/feeds/端点,但不能调用驱动器。

我的范围相当完整:('https://docs.google.com/feeds/,https://docs.googleusercontent.com/,https://spreadsheets.google.com/feeds/,http://gdata.youtube.com,plus.me,drive.file,userinfo.email,userinfo.profile'不要看格式,它会在之后自动修复)并且效果很好。

我没有使用 Drive UI,我只想使用服务器端 API。感谢您的任何提示。

4

1 回答 1

5

您是否在清单中设置了 "api_console_project_id" : "xxxxxxxxxxxxx" 参数?此处提供了一个示例:manifest.json

于 2012-04-28T11:09:57.037 回答