Token creation for accessing all apis
Get Token API provides an access token as a response. This token can be used to access other APIs as authorization parameter.
Get Token Endpoint (POST Format)
Request Header
Include the following request headers:
Parameter | Value | Required |
---|---|---|
Content-Type | application/json | YES |
Accept | application/json | NO |
Request Parameters
Include the following request parameters
Parameter | Type | Required | Description |
---|---|---|---|
client_key | String | YES | Client Key – Provided by VivaroPay after registration |
secret_key | String | YES | Secret Key – Provided by VivaroPay after registration |
Example Code
curl --location 'https://vivaropay.live/api/v1.0.0-beta/getToken' \
--header 'Content-Type: application/json' \
--data '{
"client_key": "YOUR CLIENT KEY",
"secret_key": "YOUR SECRET KEY"
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://vivaropay.live/api/v1.0.0-beta/getToken',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"client_key": "YOUR CLIENT KEY",
"secret_key": "YOUR SECRET KEY"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Success Response
{
"status": true,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJUb2tlbiIsImlhdCI6MTcwNjg0OTYyNCwiZXhwIjoxNzA2ODUzMjI0LCJkYXRhIjoiZmFlMjRmZGQ1Y2VlNWJkMzc1NThmNWU3OWRmOGVlZTBjNjI4YWUwNzViZjUxZThmOGVjY2FmYzdhMTdmM2YwNTBjZmM2OGUzNzEwOWE3YWZlYTBmOGZlN2ViOThmZTUyNjc1NDBhNWMwZjI4ZGQxNDY5NWM0NGFlZjEwOTk5ZmFJNmVrOUVJR3hBbytaT09tcXNHNXZJWUtsdnJqSGxRZ2dycW1TK2FJRXc9PSJ9.OMRcJf7sLGjxGF5vbMRedyTUZeDIA4pPuLzac3SKd5U",
"expire": 3600,
"statusMessage": "Token generated"
}