Authentication
To access CRS API resources, authentication is required. This process involves obtaining a user token via login, which must then be included in subsequent API requests.
Login Request
Method: POST
URL: {host_url}/api/security/Authentication/Login
Minimal Request:
{
"userNameOrEMail": "your_username",
"password": "your_password",
"tenantDomainName": "your_tenant"
}
Response Structure
All CRS responses follow a standardized structure containing an errorOrValue
property. The error
field will be null
in successful cases, and the value
field will contain the operation result.
Successful Response Example:
{
"error": null,
"value": {
"token": "your_access_token"
}
}
Using the Authentication Token
Upon successful authentication, the response will include a "token"
field. This token must be included in the Authorization
header of all subsequent API requests:
Example Header Usage:
Authorization: Bearer your_access_token
Best Practices
- Store the token securely and refresh it periodically if required.
- Avoid exposing the token in client-side applications or logs.
- Use HTTPS to secure authentication requests.
By implementing this authentication flow, you ensure secure access to CRS API endpoints while protecting user credentials and session integrity.