Session ID Authentication - Login API
Session ID authentication is a secure, session-based mechanism that allows a user or system to access Contact Center APIs after a successful login.
When a user logs in through the authentication API, the system generates a Session ID token that uniquely represents that user's authenticated state. This Session ID must be passed with subsequent API requests until the session expires or the user logs out.
How it works​
Login: The client application calls the login API with valid user credentials and configuration parameters. The server responds with a sessionId token.
Use Session ID: For every subsequent API request, the Session ID is included — either in the request header (recommended) or as part of the authentication field in the payload, depending on the API design.
Session Lifecycle:
- Each Session ID is time-bound and user-specific.
- A session automatically expires after a configured timeout or explicit logout.
- On expiry, the client must request a new Session ID via the login API.
HTTP Request​
POST <Protocol>://<IP_Domain_Name>:<port>/ameyorestapi/session/userLogin
Request Parameters​
The following are the POST parameters sent as raw in the Body of the Request:
| Parameter | Type | Description |
|---|---|---|
userId | String | The user's login ID for the Contact Center dashboard. Uniquely identifies the user within the system. |
token | String | The user's password or access key associated with the login ID. Used to authenticate the login request. |
forceLogin | Boolean | If set to true, the system allows the user to log in even if an active session already exists (used for session recovery or multi-terminal logins). |
terminalInfo | String | Metadata describing the terminal, browser, or device initiating the login (e.g., "Agent Desktop", "Chrome", "WebSDK"). |
Example Request​
curl --location 'https://<IP_Domain_Name>:<port>/ameyorestapi/session/userLogin' \
--header 'Content-Type: application/json' \
--data '{
"token": "doc_admin",
"userId": "doc_admin",
"forceLogin": true,
"terminalInfo": "test"
}'
Example Response​
{
"userId": "doc_admin",
"terminalIp": "0.0.0.0",
"localIp": "0.0.0.0",
"sessionId": "d898-600087a3-ses-doc_admin-lYsFDHJiGg1OzkBdCeNIj...",
"loginTime": 17627834209072,
"userType": "Administrator",
"contactCenterId": 1,
"userName": "doc_admin",
"lastLoginInfo": {
"userId": "doc_admin",
"userName": "doc_admin",
"lastLoginTime": 17627885504129,
"sessionId": "d898-600087a3-ses-doc_admin-..."
}
}
HTTP Response​
On success, the HTTP response status code will be 200.