> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zilliant.com/llms.txt
> Use this file to discover all available pages before exploring further.
# Request an access token
> Use this endpoint to obtain a Salesforce OAuth 2.0 token response that you will use to authenticate calls to Zilliant APIs.
Where to send the request Send this POST request to your Salesforce org's My Domain URL: https://<my-domain>.my.salesforce.com Use the My Domain URL for the target Salesforce org. If Zilliant owns and administers the Salesforce org, contact your Zilliant representative for this value. Otherwise, contact your Salesforce administrator to obtain the My Domain URL.
What to do with the response Salesforce returns a JSON token response. Base64-encode the entire response body (encode the full JSON payload, not only the `access_token` field). Then include the encoded value in the `Authorization` header for Zilliant API requests in this format: `Authorization: OAuth `.
Environment-specific tokens Generate and use a separate token response for each environment, for example, DEV and PROD. Do not reuse a token response across environments.
Rate limits and caching Salesforce limits authentication calls to 3600 calls per hour per user. Cache the token response and reuse it until the token expires. When it expires, request a new token response, Base64-encode it, and update the `Authorization` header value.
## OpenAPI
````json POST /services/oauth2/token
{
"openapi": "3.0.0",
"info": {
"title": "Zilliant Customer API Reference",
"version": "1.0.0",
"description": null
},
"servers": [
{
"url": "https://{ApiHost}",
"description": "Customer-specific API base URL",
"variables": {
"ApiHost": {
"default": "mycompany.zilliant.com",
"description": "Your customer-specific API hostname."
}
}
}
],
"paths": {
"/services/oauth2/token": {
"post": {
"servers": [
{
"url": "https://{SalesforceMyDomain}",
"description": "Salesforce org-specific My Domain server.",
"variables": {
"SalesforceMyDomain": {
"default": "mycompany.my.salesforce.com",
"description": "Your Salesforce org-specific My Domain hostname."
}
}
}
],
"summary": "Request an access token",
"description": "Use this endpoint to obtain a Salesforce OAuth 2.0 token response that you will use to authenticate calls to Zilliant APIs.
Where to send the request Send this POST request to your Salesforce org's My Domain URL: https://<my-domain>.my.salesforce.com Use the My Domain URL for the target Salesforce org. If Zilliant owns and administers the Salesforce org, contact your Zilliant representative for this value. Otherwise, contact your Salesforce administrator to obtain the My Domain URL.
What to do with the response Salesforce returns a JSON token response. Base64-encode the entire response body (encode the full JSON payload, not only the `access_token` field). Then include the encoded value in the `Authorization` header for Zilliant API requests in this format: `Authorization: OAuth `.
Environment-specific tokens Generate and use a separate token response for each environment, for example, DEV and PROD. Do not reuse a token response across environments.
Rate limits and caching Salesforce limits authentication calls to 3600 calls per hour per user. Cache the token response and reuse it until the token expires. When it expires, request a new token response, Base64-encode it, and update the `Authorization` header value.\n",
"requestBody": {
"description": null,
"required": true,
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"type": "object",
"properties": {
"grant_type": {
"type": "string",
"description": "OAuth 2.0 grant type. Must be set to client_credentials.",
"enum": [
"client_credentials"
]
},
"client_id": {
"type": "string",
"description": "Consumer key of the Zilliant OAuth connected app or external client app. If Zilliant owns and administers the Salesforce org, contact your Zilliant representative for this value.\n"
},
"client_secret": {
"type": "string",
"format": "password",
"description": "Consumer secret of the Zilliant OAuth connected app or external client app. If Zilliant owns and administers the Salesforce org, contact your Zilliant representative for this value.\n"
}
},
"required": [
"grant_type",
"client_id",
"client_secret"
]
}
}
}
},
"responses": {
"200": {
"description": "Successful response returning an access token.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"access_token": {
"type": "string",
"description": "OAuth 2.0 access token."
},
"instance_url": {
"type": "string",
"format": "uri",
"description": "Base URL of your Salesforce instance."
},
"id": {
"type": "string",
"format": "uri",
"description": "Identity URL that includes the organization ID and user ID."
},
"token_type": {
"type": "string",
"description": "Type of token."
},
"issued_at": {
"type": "string",
"description": "Time at which the access token was issued.\n"
},
"signature": {
"type": "string",
"description": "Signature that you can use to verify the access token."
}
},
"required": [
"access_token",
"instance_url",
"id",
"token_type",
"issued_at",
"signature"
]
},
"example": {
"access_token": "",
"instance_url": "",
"id": "",
"token_type": "Bearer",
"issued_at": "