How to use Access Token in Trustpilot API - Hack The Tech - Latest News related to Computer and Technology

Hack The Tech - Latest News related to Computer and Technology

Get Daily Latest News related to Computer and Technology and hack the world.

Thursday, January 27, 2022

How to use Access Token in Trustpilot API

Using the Trustpilot API, I was able to request the access and refresh token, but when I try to use them, it doesn't work.

Fetching the Invitation Templates (API Documentation), with the following header, using the access_token value in the Authorization header and the API KEY value for the apikey header:

        [Content-Type] => application/x-www-form-urlencoded
        [Authorization] => Bearer ABCDEFGabcdefg123456123456
        [apikey] => foooooooooooooooooooo123456

I got an HTTP Code 403 with no message in the body, while if I use the refresh_token, I got a 401 code with the following message:

"fault":{"faultstring":"Invalid Access Token","detail":{"errorcode":"keymanagement.service.invalid_access_token"}

As far as I got, I should be able to use the refresh_token too as it should not expire.

From the documentation: Once the access token expires, issue the same request to obtain a new token or use the refresh token obtained in the response.

Any idea of what I am doing wrong?



source https://stackoverflow.com/questions/70868278/how-to-use-access-token-in-trustpilot-api

No comments:

Post a Comment