gpt4 book ai didi

android - OLA API 集成给出错误作为无效的合作伙伴 key

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:45:22 25 4
gpt4 key购买 nike

我想为我的项目使用 OLA API。所以我跟着official docs 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())

如文档中所述,我也在请求 header 中包含了 X-APP-TOKEN。但我遇到了以下问题。

{'code': 'invalid_partner_key', 'message': 'Partner key is not authorized'}

如有任何帮助,我们将不胜感激。

最佳答案

测试(沙盒)时需要使用以下网址:

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

关于android - OLA API 集成给出错误作为无效的合作伙伴 key ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39225859/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com