Skip to content

Issue Access Token

The following is the method for requesting an access token to access the ZRMZ APIs.


Request URL

url
POST https://api.zerva.app/api/v1/oauth/token

Request Body Parameters

NameTypeRequiredDescription
grant_typeStringAssigns "client_credentials"
client_idStringThe client ID you received from CMS.
client_secretStringThe client secret you received from CMS.

Example

json
{
    "grant_type": "client_credentials",
    "client_id": "0123456789abcdef0123456789abcdef",
    "client_secret": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
}

Request Example

sh
curl -X POST 'https://api.zerva.app/api/v1/oauth/token' \
-H 'Content-Type: application/json' \
-d '{
    "grant_type": "client_credentials",
    "client_id": "0123456789abcdef0123456789abcdef",
    "client_secret": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
}'

Response

NameTypeDescription
tokenStringAn access token for authentication, used for calling the customer API.
expired_atStringExpiration date of the access token.

Example

json
{
    "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE3Mjg0NjYyNzYsImV4cCI6MTcyOTA3MTA3NiwiYXVkIjoiZjZlNzYyOGQ1ZTBmYjY2MDRjZTk5NmM0N2U2NTIwMzciLCJpc3MiOiJaUk1aIiwic3ViIjoiT0F1dGgiLCJqdGkiOiJiYjZhMGQ0OS04MzcxLTQ3OWEtYjRmMi0zODNmZTIyMjczNDgifQ.4rILMnCIysPcOjx7kl2eugODnIDCjxyz3KrusndNyoc",
    "expired_at": "2024-10-16T09:31:16.535Z"
}