我正在编写一个基于 uber apis 的应用程序。为此,我在使用 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'}