【问题标题】:How get Business Unit ID from Trustpilot如何从 Trustpilot 获取业务部门 ID
【发布时间】:2020-09-01 18:12:53
【问题描述】:

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

【问题讨论】:

    标签: python request trustpilot


    【解决方案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
    

    【讨论】:

      猜你喜欢
      • 2021-07-23
      • 2021-07-08
      • 2023-02-16
      • 2016-04-11
      • 1970-01-01
      • 1970-01-01
      • 2017-03-12
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多