Authorization

Request access token

Before you can successfully request a SalesMessage API, you must obtain an access token that grants access to the API.<br><br>The code your application receives at your Redirect URI is a temporary authorization code that is used to obtain an access token to call the API.<br><br>If the token is not redeemed in the alotted time, the user will need to go through the login and authorization process again.

post/oauth/token

Request

  • Base URL
    https://api.salesmessage.com/pub/v2.3
  • URL
    https://api.salesmessage.com/pub/v2.3/oauth/token
  • Auth
    none declared

Request body application/x-www-form-urlencoded

grant_type'authorization_code' required

Must be set to authorization_code.

codestring required

The authorization code returned from the Get the User’s Permission request.

client_idstring required

The client_id is the identifier for the app. Find it on the OAuth Applications page.

client_secretstring required

The client_secret is the secret of the app. Find it on the OAuth Applications page.

redirect_uristring required

This parameter is used for validation only (there is no actual redirection). The value of this parameter must exactly match the value of redirect_uri supplied when requesting the authorization code.

Example request

{
  "grant_type": "authorization_code"
}

Response

OK

token_typestring text
expires_instring text
access_tokenstring text
refresh_tokenstring text

Example response

{
  "token_type": "Bearer",
  "expires_in": "31536000",
  "access_token": "ouath token string",
  "refresh_token": "ouath token string"
}

Changes

No recorded changes to this operation across all 3 revisions of this API.