Password
The Password grant type enables you to use your userâs Trustpilot Business username and password for authentication. You can only use this grant type from the server side to avoid exposing your API Secret and user credentials.
Request an access token
Section titled âRequest an access tokenâTo request a token, use your API Key, API Secret, Trustpilot username and password.
Method: POST
https://api.trustpilot.com/v1/oauth/oauth-business-users-for-applications/accesstoken
Headers
Section titled âHeadersâAuthorization: Basic [BASE64_ENCODED(API_KEY:API_SECRET)]
Content-Type: application/x-www-form-urlencoded
You must concatenate and base64 encode your API Key and API Secret.
Payload
Section titled âPayloadâ| Name | Type | Description |
|---|---|---|
| grant_type | Required string | Value must be set to password |
| username | Required string | Your Trustpilot b2b login email |
| password | Required string | Your Trustpilot b2b login password |
Example
Section titled âExampleâgrant_type=password&username=email@domain.com&password=PasswordResponse
Section titled âResponseâThe response contains the access token, refresh token and time of expiration:
{ access_token: "AccessToken", refresh_token: "RefreshToken", expires_in: "359999"}When the access token expires, issue the same request to get a new token. You can also use the refresh token from the response.