如何从 Trustpilot 获取业务单位 ID

How get Business Unit ID from Trustpilot

我无法从 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

我发现如果将 apikey 添加到 headers,它会起作用。 最后看起来像这样:

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