Skip to main content

Token Generation

Generate a Bearer authentication token for Contact Center API access.

The Temporary Authorization token can be obtained through a browser by logging in as the admin user of the specific Contact Center instance. Once you have the credentials, encode them using Base64 (username:password) to use with the API.

HTTP Request​

POST https://<IP_Domain_Name>:<port>/configuration/basicauth

Request Headers​

HeaderValue
acceptapplication/json
Content-Typeapplication/json
AuthorizationBearer <existing_token>

Request Parameters​

ParameterTypeRequiredDescription
usernameStringYesThe unique identifier for the user account making the API request. This user must have appropriate permissions to perform the requested actions.
passwordStringYesThe authentication password associated with the provided username. Transmit over HTTPS.
contextStringYesDefines the specific application or service module the API call is intended for. For all contact center operations, set this to "ContactCenter".
contextIdStringYesThe unique ID of the specific contact center instance or tenant you are targeting. Ensures the request is routed to the correct environment.
dateExpiryStringNoISO 8601 timestamp specifying when the session or token will expire. If not provided, a default session timeout applies. Example: "2030-05-19T12:20:57.310Z"
userRoleStringYesDefines the permission level of the user making the request. Determines which actions the user is authorized to perform. Example: "Administrator"

Example Request​

curl --location 'https://<IP_Domain_Name>:<port>/configuration/basicauth' \
--header 'accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <existing_token>' \
--data '{
"username": "customer_manager",
"password": "customer_manager@123",
"context": "ContactCenter",
"contextId": "1",
"dateExpiry": "2030-05-19T12:20:57.310Z",
"userRole": "Administrator"
}'

Base64 Encoding​

To create a token, credentials need to be encoded using Base64 in the format username:password. For example:

customer_manager:customer_manager@123$

You can use an online tool like Base64 Encode for this purpose.

HTTP Response​

On success, the HTTP response status code will be 200. The response returns a Bearer token to use in subsequent API calls.

HTTP Status Codes​

CodeDescription
200Success — Token generated
400Bad Request — Invalid input or malformed request
401Unauthorized — Missing or invalid credentials
403Forbidden — User not permitted to access this resource
500Internal Server Error