v1

latestOpenAPI 3.0.02026-07-131091452.6 MB
oauth

Get access tokens

This endpoint returns an access token for the specified user and with the specified scopes. The token does not expire until the user changes their password. The body parameters must be encoded as form data.

post/v2/oauth/access_token

Request body

client_idstring required

Client ID (Consumer Key) of your application

client_secretstring

Client Secret (Consumer Secret) of your application

codestring

Response code from the /oauth/authorize flow; required if grant_type=authorization_code

grant_type'authorization_code' | 'client_credentials' | 'refresh_token' required

Grant type: authorization_code generates user tokens, client_credentials generates short-lived client grants

realm'customer' | 'contributor'

User type to be authorized (usually 'customer')

expiresboolean

Whether or not the token expires, expiring tokens come with a refresh_token to renew the access_token

refresh_tokenstring

Pass this along with grant_type=refresh_token to get a fresh access token

Response

OK

access_tokenstring required

Access token that can be used for future requests

expires_ininteger

Number of seconds before token expires, only present for expiring tokens

token_typestring required

Type of token

refresh_tokenstring

A refresh token that can be used to renew the access_token when it expires, only present for expiring tokens

user_tokenstring

Metadata about the access_token, only present for expiring tokens

Example response

{
  "access_token": "v2/NmQwOTc0NTBiMjA5YzZkY2Q4NTkvMTA4OTg1MDk5L2N1c3RvbWVyLzIvZjB2a0RseGo4Rkt6ZjRmVWJNMm10V2VzcHh1NTBlZWJ6andUQU1NeTVYYnNFTDVWOFRJakItS2RnZTlmbEY1Y3haNWdXLUtYc2JhaXo5djk0V0p2QzZUUWZ4c2FNWm41NkdLYUgyVWlCaVUtQTNVMV9YQWpzd3lpblI3SlZEem8wSG1qQ2NzSkJlX3VQTnNXenBIdkd4SXViVi1rRGJTVENCV0g1U3U0RXRJSV9rSm5lQkl5QXlvbm5JN241UUhv",
  "token_type": "Bearer"
}