OLA API集成将错误视为无效的伙伴密钥

Har*_*man 4 python api android

我想为我的项目使用OLA API.所以我按照 OLA 的官方文档使用python请求尝试了以下内容.该请求期望从源到目的地的乘坐估计的响应.

import requests

headers = {'X-APP-TOKEN' : "your_api_token"}
payload= {'pickup_lat': 12.9490936, 'pickup_lng': 77.67773056, 'drop_lat': 12.9190934, 'drop_lng': 77.1777356, 'category': 'micro'}
response = requests.get('https://devapi.olacabs.com/v1/products', params=payload, headers=headers)
print(response.json())
Run Code Online (Sandbox Code Playgroud)

正如文档中所提到的,我在请求标题中也包含了X-APP-TOKEN.但是我得到了以下问题.

{'code': 'invalid_partner_key', 'message': 'Partner key is not authorized'}
Run Code Online (Sandbox Code Playgroud)

任何帮助将受到高度赞赏.

小智 5

您需要在测试时使用以下URL(沙箱):

http://sandbox-t.olacabs.com/v1/products