Get Access Token
Get an authorized access to API communications
Overview
Access Token acts as an authentication value that helps SingleView APIs determine that a request is valid and is made by an authorized person.
A user should process a POST
request to the concerned end-point to generate an access token.
Endpoint details
Endpoint URL | Method | Authentication requirements |
---|---|---|
/v1/api/svplatform/tokenOauth2 | POST | 1. CompanyId 2. SVReferenceID 3. DateTimeStamp 4. Device |
The request is posted to the endpoint mentioned above in the specified format with all the required details. The system then processes the information to authenticate, and a response is generated based on the validity of the details.
Sample request
curl --location 'https://sandboxapi.onesingleview.com/v1/api/svplatform/tokenOauth2' \
--header 'CompanyId: MYCOMPANY'
--header 'SVReferenceID: BEMC0001'
--header 'DateTimeStamp :2025-01-02T10:20:39'
--header 'Device: Web'
--header 'Content-Type: application/json'
--data-raw '{
"clientId": "abcdef83643f61c975",
"clientCode": "zyxvw95cE163C03b7d1",
"grant_type": "client_credentials",
}'
Description:
JSON Tag | Description | Data type |
---|---|---|
clientId Mandatory | Unique client identification details | String |
clientCode Mandatory | Unique client secret code for authentication | String |
grant_type Mandatory | Type of grant provided for authentication. Here as client_credentials | String |
Sample response
Successful response
✔️ Response occurs if the request is valid and is successfully authenticated and processed
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkYXRhIjoiTDNyMmpxV29JS2I4MTNodDBNMlZ4WGpFZmR6WFNWaTFad3B5QnlkOVpHelZXR2ZwUmFQNUV1TXl6S1Aybi94Y0lwR2V5STNNMkdPL1pqakd4ZG0yclJKUkdhRXlaWGNpWnZnOHArMWIyOGtOQTVkZ0VKajVVSEdiTmtNPSIsImlhdCI6MTczNTgwMTQ3NywiZXhwIjoxNzM1ODA1MDc3fQ.Bh7LFkvxNFrLe9dmH5rURWjGpES-u4z2EGeyrNM7z6E",
"token_type": "Bearer",
"expires_in": "6000"
}
Description:
JSON Tag | Description | Data type |
---|---|---|
access_token | Access token | String |
token_type | Type of token | String |
expires_in | Time for expiry of the access token | String |
Failed Response
❌ Response occurs if the request is processed but have encountered a service downtime/connection refusal.
{
"success": false,
"payload": {},
"message": "Connect Refused"
}
Description:
JSON Tag | Description | Data type |
---|---|---|
success | Status of the process represented as true or false | Boolean |
payload | Tag carrying information on the payload | Object |
message | Message representing the information on the error encountered | String |
Updated 10 days ago