文档端点
https://developer.uber.com/docs/ride-requests/references/api/v1-requests-request_id-receipt-get
我的应用已经拥有request_receipt
但是,在我的Rails应用程序中,当我在:/v1/requests/my-request-id-here/receipt
请求端点API时,我收到如下所示的完整消息:
#<HTTParty::Response:0x7f8738f833f8 parsed_response={"message"=>"Forbidden", "code"=>"forbidden"}, @response=#<Net::HTTPForbidden 403 Forbidden readbody=true>, @headers={"server"=>["nginx"], "date"=>["Wed
, 02 Nov 2016 14:31:37 GMT"], "content-type"=>["application/json"], "content-length"=>["42"], "connection"=>["close"], "x-uber-app"=>["uberex-nonsandbox", "migrator-uberex-optimus"], "strict-transport-sec
urity"=>["max-age=0"], "x-content-type-options"=>["nosniff"], "x-xss-protection"=>["1; mode=block"]}>
你有什么建议吗?开发人员的优步API很差!
答案 0 :(得分:0)
当您授权用户并获得访问令牌时,问题很可能是您没有请求新范围。访问令牌仅限于用户批准的范围(因此,即使在仪表板中启用了该范围),您也需要传递“request_receipt”&#39;验证用户时的范围。
请参阅身份验证指南中的更多详细信息:https://developer.uber.com/docs/ride-requests/guides/authentication/introduction#step-one-authorize
如果使用范围创建新的访问令牌,则all应按预期工作。