Access Token

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.

Access Token

Make a call to this endpoint to exchange a temporary authorization code for an access token.

Request Body schema: application/x-www-form-urlencoded
grant_type
string

Type of grant. Currently, authorization_code is the only accepted type.

code
string

Authorization code provided after the user authorizes the scopes during the application install process.

redirect_uri
string

The same redirect URI that was used when requesting the authorization code.

client_id
string

The application’s client ID which can be found on the Manage Distribution tab for the application.

client_secret
string

The application’s client secret which can be found on the Manage Distribution tab for the application.

Responses

Request samples

curl -i -X POST \
  https://api.attentivemobile.com/v1/authorization-codes/tokens \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d client_id=9f7a2f11a4f849f59268869ec766111c \
  -d client_secret=0FvaRpPi5KBC4Izj9ALA0AG8J2WdcBhU \
  -d code=MTQ0NjJkZmQ5OTM2NDE1ZTZjNGZmZjI3 \
  -d grant_type=authorization_code \
  -d redirect_uri=https://test.com

Response samples

Content type
application/json
{
  • "access_token": "riSm9jz2Tq2XKO8ZqS1+CJg8tOJ8cALn19zRlQc9s1"
}