0

我已经在 trustpilot 中设置了我的应用程序,因为我想使用它的 API。我有 API 密钥和秘密。到目前为止,一切都很好。但是当我使用它通过邮递员获取授权码时,我得到的是 HTML 响应而不是密钥。我正在关注此处给出的授权代码流程:https ://developers.trustpilot.com/authentication

我在邮递员中使用此 URL 进行 GET 请求:https ://authenticate.trustpilot.com?client_id=APIKEY&redirect_uri=xxxxx&response_type=code

redirect_uri 是我放在应用程序中的那个。它确实有https。所以它就像https://myCompany.com.au

问题:如何获取授权码?

更新:最后我使用了密码流,它给了我一个 359999 秒的访问令牌。现在,每当我想获得评论时,我首先通过 GET 请求进行身份验证,并每次都获取新的访问令牌。

4

1 回答 1

0

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.

于 2018-07-17T07:16:09.090 回答