Skip to navigation

Get a 2-legged access token

View as Markdown

Exchanges your app’s client ID and client secret for a 2-legged access token. Client authentication may be sent either in the body (below) or as a Authorization: Basic base64(client_id:client_secret) header, but not both — sending both returns 400.

Request

This endpoint expects an object.
grant_typeenumRequiredDefaults to client_credentials

Must be client_credentials for a 2-legged token.

Allowed values:
client_idstringRequired
The client ID of your APS app.
client_secretstringRequired
The client secret of your APS app.
scopestringOptional

Space-separated list of scopes the token should carry, for example account:read account:write.

Response

An access token.
access_tokenstring

The access token to send in the Authorization header.

token_typestring

Always Bearer.

expires_ininteger
Lifetime of the access token, in seconds.

Errors

400
Bad Request Error
401
Unauthorized Error