【发布时间】:2017-09-12 22:56:49
【问题描述】:
我想获得授权访问权限,用于 google drive api 调用。
我使用 ruby 和 HTTParty gem。
我遵循了这个快速入门示例:https://developers.google.com/drive/v3/web/quickstart/ruby
然后,我想使用 HTTParty 来使用这个 API,我知道我必须通过上面的凭据获得用户的 access_token 来获得授权,但是当我尝试这个代码时HTTParty.get('https://www.googleapis.com/drive/v3/about', headers: {'Authorization' => "Bearer #{service.authorization.access_token}"})
我有这个错误状态:
...."code"=>400, "message"=>"The 'fields' parameter is required for this method."}}, @response=#<Net::HTTPBadRequest 400 Bad Request readbody=true>,....
我的目标是对 Google Drive API 的使用进行一些测试。
我应该如何获得此 API 的授权访问权限?
【问题讨论】:
标签: ruby google-drive-api httparty