Get Access Token
POST/oauth/token
Use Access Tokens to access CRM resources on behalf of an authenticated location/company.
Request
API Version
v3- application/x-www-form-urlencoded
- Body
- Example (auto)
Bodyrequired
The ID provided by CRM for your integration
The client secret provided by CRM for your integration
The OAuth2 grant type — authorization_code, refresh_token, or client_credentials
authorization_coderefresh_tokenclient_credentialsThe authorization code received from the authorization endpoint (required for authorization_code grant)
The refresh token used to obtain a new access token (required for refresh_token grant)
The type of token to be requested
CompanyLocationThe redirect URI for your application
{
"client_id": "6578278e879ad2646715ba9c",
"client_secret": "ab12dc0ae1234a7898f9ff06d4f69gh",
"grant_type": "authorization_code",
"code": "ab12dc0ae1234a7898f9ff06d4f69gh",
"refresh_token": "xy34dc0ae1234a4858f9ff06d4f66ba",
"user_type": "Location",
"redirect_uri": "https://myapp.com/oauth/callback/crm"
}
Successful response
- application/json
- Schema
- Example (auto)
Schema
The OAuth2 access token
The token type (always Bearer)
Time in seconds until the access token expires
The OAuth2 refresh token used to obtain a new access token
Space-separated list of scopes the access token has access to
The user type associated with the token (Location or Company)
Location ID - Present only for Sub-Account Access Token
Company ID
Approved locations to generate location access token
USER ID - Represent user id of person who performed installation
Plan Id of the subscribed plan in paid apps.
Indicates whether the installation was performed as a bulk installation
Boolean to control if user wants app to be automatically installed to future locations (only for company tokens)
Boolean indicating if user approved all locations during bulk installation (only for company tokens)
{
"access_token": "ab12dc0ae1234a7898f9ff06d4f69gh",
"token_type": "Bearer",
"expires_in": 86399,
"refresh_token": "xy34dc0ae1234a4858f9ff06d4f66ba",
"scope": "conversations/message.readonly conversations/message.write",
"userType": "Location",
"locationId": "l1C08ntBrFjLS0elLIYU",
"companyId": "l1C08ntBrFjLS0elLIYU",
"approvedLocations": [
"l1C08ntBrFjLS0elLIYU"
],
"userId": "l1C08ntBrFjLS0elLIYU",
"planId": "l1C08ntBrFjLS0elLIYU",
"isBulkInstallation": false,
"installToFutureLocations": true,
"approveAllLocations": true
}