【问题标题】:Uber-api endpoint for history is not working after authorization历史记录的 Uber-api 端点在授权后不起作用
【发布时间】:2015-06-04 21:55:52
【问题描述】:

我正在编写一个基于 uber api 的应用程序。 为此,我在使用 oauth2 进行身份验证时使用“profile history_lite request”作为范围。身份验证后,我正在调用端点:-

'https://api.uber.com/v1/history'
这给出了错误 401:- "message":"至少需要一个范围。可用范围:","code":"unauthorized"

但其他端点“https://api.uber.com/v1/products?latitude=37.7759792&longitude=-122.41823”正在工作。

我是否需要任何其他权限才能使第一个端点工作或者我遗漏了什么?

我使用 python requests lib 进行 api 调用,看起来像:-

res = requests.get(endpoint, headers=headers) 

headers 是一个映射,其值为

{'Content-Type': 'application/json', 'Authorization': 'Bearer xxx-acces-token-xxx'}

【问题讨论】:

  • 我也遇到了 /requests 相同的问题,但在沙盒环境中。任何解决方案

标签: uber-api


【解决方案1】:

/v1/history(需要history 范围)已被弃用,不再可用。

/v1.1/history 仍然可用,并且可以使用history_lite 范围访问。

【讨论】:

  • 嗨,斯科特,感谢您的及时回复。我应该对所有端点使用 v1.1 吗?
猜你喜欢
  • 2011-01-05
  • 2012-08-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-28
  • 2021-09-30
  • 1970-01-01
相关资源
最近更新 更多