Python 如何从Trustpilot获取业务部门ID
我无法从API Trustpilot获取业务部门ID。 我尝试使用不同的授权方式,但仍然未经授权。 来自的文档没有帮助。 我也尝试过token,但仍然存在相同的问题-未经授权 有人能告诉我我做错了什么吗 我的Python代码:Python 如何从Trustpilot获取业务部门ID,python,request,trustpilot,Python,Request,Trustpilot,我无法从API Trustpilot获取业务部门ID。 我尝试使用不同的授权方式,但仍然未经授权。 来自的文档没有帮助。 我也尝试过token,但仍然存在相同的问题-未经授权 有人能告诉我我做错了什么吗 我的Python代码: import requests apikey= xxxxx URL = 'https://api.trustpilot.com/v1/business-units/find?name=b_name?apikey={0}'.format(apikey) response =
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添加到标题中,它将起作用。 最后看起来是这样的:
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