Get access token

Prev Next

The C3 REST APIs are secured using OAuth 2.0 authentication through Azure Active Directory. All API requests must include a valid access token in the Authorization header using the Bearer authentication scheme.

Access tokens can be obtained programmatically using the OAuth 2.0 Client Credentials flow, which is suitable for server-to-server integrations, background services, and applications that do not require user interaction.

Generate Access Token

https://login.microsoftonline.com/{{tenantID}}/oauth2/token

Endpoint Parameters

ParameterRequiredDescription
{{tenantID}}YesPartner Tenant ID used to authenticate against Azure Active Directory.

Request Headers

HeaderValue
Content-Typeapplication/x-www-form-urlencoded

Request Body

The request body must be submitted as application/x-www-form-urlencoded.

ParameterValueDescription
grant_typeclient_credentialsSpecifies the OAuth 2.0 Client Credentials flow.
client_id<to-be-provided-offline>Application (client) identifier issued for API access.
client_secret<to-be-provided-offline>Secret key associated with the client application.
scope<to-be-provided-offline>Scope requested for the access token.
resource<to-be-provided-offline>Target resource for which the access token is requested.
Important

The values for client_id, client_secret, scope, and resource are provided separately as part of the partner onboarding process.

Successful Response

A successful request returns an OAuth access token that can be used to authenticate subsequent requests to the C3 REST APIs.

Sample Response

{
  "token_type": "Bearer",
  "expires_in": "3599",
  "ext_expires_in": "3599",
  "expires_on": "1587227232",
  "not_before": "1587223332",
  "resource": "001dfc3c-1cbf-406e-b592-de9f67f5ab62",
  "access_token": "<access_token>"
}

Response Properties

PropertyDescription
token_typeAuthentication scheme associated with the access token. The value is typically Bearer.
expires_inNumber of seconds until the access token expires.
ext_expires_inExtended expiration time of the access token in seconds.
expires_onTimestamp indicating when the access token expires.
not_beforeTimestamp indicating when the access token becomes valid.
resourceIdentifier of the resource for which the access token was issued.
access_tokenOAuth access token used to authenticate requests to the C3 REST APIs.

Using the Access Token

Include the value returned in the access_token property in the Authorization header of all subsequent API requests.

Authorization: Bearer <access_token>
Note

All C3 REST API requests require a valid access token. Requests made with an expired, invalid, or missing access token will be rejected.