We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to obtain an access token using the documented OAuth2 client_credentials grant:
client_credentials
import { TrustpilotApi } from "trustpilot"; ;(async () => { const client = await new TrustpilotApi({ key: '<api_key>', secret: '<api_secret>', grantType: 'client_credentials', baseUrl: 'https://api.trustpilot.com' }).authenticate(); const res = await client.get('/v1/business-units/all'); console.log(res.data); })()
However, authentication fails with:
status: 520, statusText: 'Unknown error', headers: Object [AxiosHeaders] { 'content-type': 'text/plain', 'content-length': '0', connection: 'close', date: 'Tue, 20 Aug 2024 13:02:05 GMT', 'x-cache': 'Error from cloudfront', via: '1.1 9aac88bd0767f985559187c36e716276.cloudfront.net (CloudFront)', 'x-amz-cf-pop': 'CHP50-C2', 'x-amz-cf-id': 'iX0LXSapKKvz7glJYMw9LrevY8t4kOTugsUdn1GtQavCzpVGSeE0IQ==' }, config: { transitional: [Object], adapter: [Array], transformRequest: [Array], transformResponse: [Array], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: [Object], validateStatus: [Function: validateStatus], headers: [Object [AxiosHeaders]], auth: [Object], baseURL: 'https://api.trustpilot.com', method: 'post', url: '/v1/oauth/oauth-business-users-for-applications/accesstoken', data: 'grant_type=client_credentials' },
If I supply invalid credentials I get a different error, HTTP 401, so it's most likely a different error.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm trying to obtain an access token using the documented OAuth2
client_credentials
grant:However, authentication fails with:
If I supply invalid credentials I get a different error, HTTP 401, so it's most likely a different error.
The text was updated successfully, but these errors were encountered: