Create a security profile
Before you can use the API, you must create a security profile. A security profile generates access tokens, which you use to access the API. To create a security profile- Sign in to your Amazon Developer Console account.
- From the top navigation, select My Settings > API Access.
- Select the
- Click Create a new security profile.
- Enter a security profile name and security profile description for your new profile, then click Save.
-
From the Web Settings tab, save your client ID and client secret as you need this information to access the API.
Associate the security profile with the API
After you create the security profile, you must associate it with the API in the Developer Console. To associate the security profile with the API- Navigate to the API Access page by selecting My Settings > API Access.
- Click the API name to expand the panel.
- Select the security profile that you created in the previous section from the drop-down list.
-
Select Attach to associate the security profile with this API.
The API name and attached security profile is added to the Security Profile(s) in use panel.
Request an LWA access token
With your client ID and client secret, use the Login With Amazon API to request a Login with Amazon access token by following these steps.Send a token request
Send aPOST request to https://api.amazon.com/auth/o2/token with the following header and content:
- Header:
Content-Type: application/x-www-form-urlencoded - Content:
client_id: The client ID you saved in the final step of Create a Security Profile.client_secret: The client secret you saved in the final step of Create a Security Profile.grant_type: Set toclient_credentials.scope:
Save the response
The following is an example response.access_token: The access token.expires_in: The number of seconds until the access token expires.scope:token_type: Alwaysbearer.
Handle any error responses
If your token request results in an error, the response message body includes one of the following error messages:| Error message body | Details |
|---|---|
{"error_description":"Client authentication failed","error":"invalid_client"} | Invalid secret key |
{"error_description":"The request has an invalid parameter : scope","error":"invalid_scope"} | Invalid scope value |
{"error_description":"The authorization grant type is not supported by the authorization server","error":"unsupported_grant_type"} | Incorrect authorization grant type |
{"error_description":"The Content-Type is not supported by the authorization server","error":"invalid_request"} | Unsupported content-type |
How to use the access token
Save your access token, which is theaccess_token field in the response from Request an LWA Access Token.
When you send requests to the API, set the Authorization header with a value of Bearer <YOUR_ACCESS_TOKEN>. The access token is a long string of characters beginning with “Atc|”.
Sample cURL request:

