我在使用Ruby时使用Google Drive存在问题.
我可以创建OAuth2客户端并开始进行身份验证调用.
我必须首先查询Google文档列表才能获取文件列表,一旦我有文件ID,我就会尝试查询Google Drive API,如下所示:
GET https://www.googleapis.com/drive/v1/files/0B9N873iFyYR7MkRfeTAxxxxxxx?access_token=ya29.AHES6ZRckKZ2jZfC6risUtH9ZZxxxxxxxxx
Run Code Online (Sandbox Code Playgroud)
但是我得到了这个:
{
"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"
}
}
Run Code Online (Sandbox Code Playgroud)
此客户端ID是指我通过Google API信息中心创建的应用程序,而不是Chrome网上应用店.
无论如何,我尝试设置一个托管的Chrome Web App,配置(并付费)所有内容以允许测试用户列表,但我仍然得到相同的错误消息,尽管该应用程序是从市场上正确安装的(不是本地副本).
使用相同的客户端和凭据,我可以调用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.谢谢你的任何提示.
| 归档时间: |
|
| 查看次数: |
2270 次 |
| 最近记录: |