Get authorization for google drive api calls in ruby with HTTParty -
i want have authorization access, google drive api calls.
i use ruby, , httparty gem.
i followed quickstart sample: https://developers.google.com/drive/v3/web/quickstart/ruby
then, want used httparty use api, , understand have authorization user's access_token obtained credentials above, when tried code httparty.get('https://www.googleapis.com/drive/v3/about', headers: {'authorization' => "bearer #{service.authorization.access_token}"})
i've got error status : ...."code"=>400, "message"=>"the 'fields' parameter required method."}}, @response=#<net::httpbadrequest 400 bad request readbody=true>,....
my goal make tests usage of google drive api.
how should have authorization access api?
i found answer question !
my error not on authorization, on fields request parameter i'd forgot!
httparty.get('https://www.googleapis.com/drive/v3/about?fields=kind,user', headers: {'authorization' => "bearer #{service.authorization.access_token}"}) example.
thank's documentation:
https://developers.google.com/drive/v3/web/performance?authuser=0#partial
see !
Comments
Post a Comment