1

我无法从 API Trustpilot 获取业务单位 ID。我尝试使用不同的授权方式,但仍然未经授权。https://developers.trustpilot.com/business-units-api#find-a-business-unit的文档没有帮助。我也尝试过令牌,但仍然有同样的问题 - 未经授权。

有人可以告诉我我做错了什么吗?

我的 Python 代码:

import requests
apikey= xxxxx
URL = 'https://api.trustpilot.com/v1/business-units/find?name=b_name?apikey={0}'.format(apikey)
response = requests.request("get", URL)
response.reason
4

1 回答 1

1

我发现如果将 apikey 添加到标题中它将起作用。最后它看起来像这样:

import requests
apikey= xxxxx
URL = 'https://api.trustpilot.com/v1/business-units/find?name=b_name'
payload = {'apikey': apikey}
response = requests.request("get", URL, headers= payload)
response.reason
于 2020-09-01T10:12:53.510 回答