Skip to main content
OAuth 2.0Version: 2021-07-28

Get Access Token

POST/oauth/token

Generate token to access CRM resources on behalf of an authenticated location/company.

Request​

Body

client_idstringrequired

The ID provided by CRM for your integration

client_secretstringrequired

The client secret provided by CRM for your integration

grant_typestringrequired

The OAuth2 grant type — authorization_code, refresh_token, or client_credentials

Available optionsauthorization_coderefresh_tokenclient_credentials
codestring

The authorization code received from the authorization endpoint (required for authorization_code grant)

refresh_tokenstring

The refresh token used to obtain a new access token (required for refresh_token grant)

user_typestring

The type of token to be requested

Available optionsCompanyLocation
Example:Location
redirect_uristring

The redirect URI for your application

Example:https://myapp.com/oauth/callback/test

Response

Successful response

access_tokenstring

The OAuth2 access token

Example:ab12dc0ae1234a7898f9ff06d4f69gh
token_typestring

The token type (always Bearer)

Example:Bearer
expires_innumber

Time in seconds until the access token expires

Example:86399
refresh_tokenstring

The OAuth2 refresh token used to obtain a new access token

Example:xy34dc0ae1234a4858f9ff06d4f66ba
scopestring

Space-separated list of scopes the access token has access to

Example:conversations/message.readonly conversations/message.write
userTypestring

The user type associated with the token (Location or Company)

Example:Location
locationIdstring

Location ID - Present only for Sub-Account Access Token

Example:l1C08ntBrFjLS0elLIYU
companyIdstring

Company ID

Example:l1C08ntBrFjLS0elLIYU
approvedLocationsstring[]

Approved locations to generate location access token

Example:["l1C08ntBrFjLS0elLIYU"]
userIdstringrequired

USER ID - Represent user id of person who performed installation

Example:l1C08ntBrFjLS0elLIYU
planIdstring

Plan Id of the subscribed plan in paid apps.

Example:l1C08ntBrFjLS0elLIYU
isBulkInstallationboolean

Indicates whether the installation was performed as a bulk installation

Example:false
installToFutureLocationsboolean

Boolean to control if user wants app to be automatically installed to future locations (only for company tokens)

Example:true
approveAllLocationsboolean

Boolean indicating if user approved all locations during bulk installation (only for company tokens)

Example:true