Public applications must authenticate using the OAuth 2.0 specification to use Attentive’s API resources. Attentive uses OAuth 2.0’s authorization code grant flow to issue access tokens on behalf of users. When an application is installed on our platform, an authorization code is generated automatically. This authorization code must be exchanged for an access token to authenticate grant and control permissions for your application.
Make a call to this endpoint to exchange a temporary authorization code for an access token.
Type of grant. Currently, authorization_code is the only accepted type.
Authorization code provided after the user authorizes the scopes during the application install process.
The same redirect URI that was used when requesting the authorization code.
The application’s client ID which can be found on the Manage Distribution tab for the application.
The application’s client secret which can be found on the Manage Distribution tab for the application.
curl -i -X POST \ https://api.attentivemobile.com/v1/authorization-codes/tokens \ -H 'Content-Type: application/x-www-form-urlencoded' \ -d grant_type=authorization_code \ -d code=MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3 \ -d redirect_uri=https://test.com \ -d client_id=9f7a2f11a4f849f59268869ec766111c \ -d client_secret=0FvaRpPi5KBC4Izj9ALA0AG8J2WdcBhU
- "access_token": "riSm9jz2Tq2XKO8ZqS1+CJg8tOJ8cALn19zRlQc9s1",
- "id_token": "riSm9jz2Tq2XKO8ZqS1+CJg8tOJ8cALn19zRlQc9s1",
- "token_type": "Bearer",
- "expires_in": 900