Before you can request an access token, you need to generate a Client ID and Client Secret. If you have already done this, find where you copied those values and be ready to copy and paste them into the Swagger UI.
For more information on how oauth2 works, you may want to read https://aaronparecki.com/oauth-2-simplified/.
This page has two procedures: the first is to generate your access token using the Client ID and Secret, and the second is to generate a new access token using the refresh token.
To generate an access token via Swagger Docs UI
- Navigate to the Swagger Docs UI for your region.
- Click the oauth2access_token operation located at the top of the list.
The only operation available is a POST operation; obtaining an access token is always a POST call.
- Click the POST operation to expand it and show the fields that must be completed.
There are several different ways to generate an access token. The instructions below are the recommended steps, but you can do it differently if you want to.
- In the grant_type field, enter
client_credentials
- In the client_id field, enter / paste the client ID value generated with your API credentials.
- In the client_secret field, enter / paste the client secret value generated with your API credentials.
- Click Try it out! at the bottom of the POST operation panel.
As long as the values you entered into the fields are valid, you will receive a response that includes an access token, the expiration time (in seconds), and a refresh token.
You may want to select and copy the Response body data into a separate text file.
To use the access token in the Swagger Docs UI, copy it from the response and paste it into the access token field at the top of the page.
As long as the pasted token is valid, you can run any API calls on the page. Once the token expires, you can repeat the above steps to generate a new one or use the Refresh token to generate a new access token.
To generate a new access token using the refresh token
- Navigate to the Swagger Docs UI for your region.
- Click the oauth2access_token operation located at the top of the list.
The only operation available is a POST operation; obtaining an access token is always a POST call.
- Click the POST operation to expand it and show the fields that must be completed.
- In the grant_type field, enter
refresh_token
- In the client_id field, enter / paste the client ID value generated with your API credentials.
- In the refresh_token field, enter / paste the refresh token value you received with your original access token.
- Click Try it out! at the bottom of the POST operation panel.
As long as the values you entered into the fields are valid, you will receive a response that includes a new access token, the expiration time (in seconds), and a new refresh token.