Business Unit ID collect and authentification

Once your application is ready you need to get your Busniess Unit ID and an authentication Token to call data of the Trustpilot API (some Trustpilot APIs are based on API Key authentication, others on Token authentication).

 

Business Unit ID

The Business Unit is the collection point for all Trustpilot content on your site / company (notes, reviews, answers). The Business Unit ID is a unique identifier which corresponds to the primary key for all your API calls.

In order to recover this key you must make a first API call via the following GET request: https://api.trustpilot.com/v1/business-units/find?apikey={{apikey}}&name=trustpilot.com

You must replace the {{apikey}} part by the API key of your App created during the previous step and the part trustpilot.com by the address of your site. In order to make this call you can use a dedicated tool like POSTMAN, which allows you to make API requests.

You will then get the ID of your Business Unit, the must-have item for most of your Trustpilot API calls. This ID is composed of several numbers and letters.

Here is an example of the result obtained (JSON format):

business_unit.png

In this example, the Business Unit ID = 46d6a890000064000500e0c3. All this step is detailed in the Trustpilot documentation, directly accessible at the following address: https://developers.trustpilot.com/tutorials/how-to-find-your-business-unit-id

 

Authentification Token generation

An authentication Token is required to use certain Trustpilot APIs, in particular those related to products. Again you can use the POSTMAN tool to retrieve this information. Trustpilot offers several methods for recovering Token.

The primary method is based on OAuth 2.0 authentication with Grant password. You will find below the elements to be filled in POSTMAN in order to obtain the Trustpilot Token. You need to make a new POST method API call.

https://api.trustpilot.com/v1/oauth/oauth-business-users-for-applications/accesstoken

 
-Headers-

'Authorization: Basic {BASE64 encoded ({api_key}:{api_secret})}'
 

-Headers-

'Content-Type: application/x-www-form-urlencoded'

 
-Body-

'grant_type=password&username={username}&password={password}'

You must replace the {BASE64 encoded ({api_key}: {api_secret})} part with the API key and the associated secret code encoded in BASE64, and the {username} / {password} part with your login and password.

You will then get a Trustpilot Token,. This Access Token is composed of several numbers and letters.

Here is an example of the result obtained (JSON format):

token.png

In this example the Access Token is blurred. All this step is detailed in the Trustpilot documentation, directly accessible at the following address: https://developers.trustpilot.com/tutorials/authentication-via-api

Have more questions? Submit a request