Use an access token to authenticate your application when calling SingleView APIs
Access Token is a secure credential used to authenticate API requests to the SingleView platform. It ensures that only authorized applications can access protected APIs.
Before calling any secured endpoints, the client must generate an access token using the Generate Access Token API. Once obtained, the token must be included in the Authorization header of all subsequent API requests.
Access tokens are issued using the OAuth 2.0 Client Credentials Grant mechanism and remain valid for a limited period.
Note: Access Token is valid for a limited period of 60 minutes from the time it is created.
Endpoint URL | HTTP Operation |
|---|---|
| POST |
curl --request POST \
--url https://obsandbox.onesingleview.com/v1/api/observice/token \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"clientId": "S4Ul6qw0iv9j",
"clientCode": "27393c66-ace9-4404-b408-d4e4aec0a460",
"merchantId": "APIU-300356",
"grantType": "client_credentials"
}
'
Parameter | Requirement | Description | Data type | Data validation |
|---|---|---|---|---|
clientId | Mandatory | Unique identifier assigned to the client application | String |
|
clientCode | Mandatory | Secret credential associated with the client application also known as Client Secret | String |
|
merchantID | Mandatory | Identifier of the merchant initiating the request | String |
|
grantType | Mandatory | OAuth grant type used to generate the token | String | To be mentioned as |
{
"success": true,
"payload": {
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"token_type": "Bearer",
"expires_in": 3600
}
}
Parameter | Description | Data type | Data validation |
|---|---|---|---|
success | Indicates whether the token generation request was successful | Enum |
|
payload | Contains token details returned by the API | Object |
|
access_token | The generated access token used for authentication | String |
|
token_type | Specifies the token type used in the Authorization header | Enum |
|
expires_in | Token validity period in seconds | Integer |
|
After generating the token, include it in the Authorization header when calling other APIs.
Header where access token to be placed
--header 'authorization: Bearer <access_token>'
All the APIs require a valid access token. Requests with missing, expired, or invalid tokens will return an Unauthorized response.