How get Business Unit ID from Trustpilot

Question:

I cannot get the Business Unit ID from API Trustpilot.
I tried to use a different way with authorization, but still, get Unauthorized.
Documentation from https://developers.trustpilot.com/business-units-api#find-a-business-unit doesn’t help.
I have also tried token, but still have the same issues – Unauthorized.

Can someone tell me what I do wrong?

My Python code:

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
Asked By: Anna

||

Answers:

I found that it will work if the apikey is added to the headers.

At the end, it looks like this:

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

See also the trustpilot api docs:
https://documentation-apidocumentation.trustpilot.com/business-units-api-(public)#find-a-business-unit

Answered By: Anna
Categories: questions Tags: , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.