Gagan
Gagan

Reputation: 1923

Trustpilot Grant Type: Authorization Code not sent instead html response is coming

I have setup my app in trustpilot as I want to use its API. I have API key and secret. So far so good. But when I am using it to get the Authorization code through postman, I am getting HTML response instead of the key. I am following the Authorization code flow given here: https://developers.trustpilot.com/authentication

I am using this URL in postman for the GET request: https://authenticate.trustpilot.com?client_id=APIKEY&redirect_uri=xxxxx&response_type=code

redirect_uri is the one which I have put in the app. It does has https in it. So its like https://myCompany.com.au

Question: How to get the Authorization code?

Update: Finally I used the password flow which gives me an access token for 359999 seconds. Now whenever I want to GET the review I first authenticate via GET request and take the fresh access token every time.

Upvotes: 0

Views: 808

Answers (1)

Remigijus
Remigijus

Reputation: 1

GET request to https://authenticate.trustpilot.com does not authorise you, but provides you a login form. After entering credentials to that form you will redirected to your site with authorization code set in query string parameter. Note that you need to provide your business user credentials. API key is not enough to perform authorization. Also you will need to exchange authorization code to access token and use access token to make API calls.

While testing with Postman it would be easier to use password flow. You would need only a single POST request to get access token.

Upvotes: 0

Related Questions