Authentication
Learn how to authenticate with the Zoqq API.
Obtain Access Tokenโ
This API authenticates and retrieves an access token for API operations.
To get started, you must first obtain an access token, which is required to access all other API endpoints.
Use your unique Client ID and X-API Key to call the Authentication API. Upon a successful request, you will receive a unique Auth Code that remains valid for approximately 30 minutes.
During this period, you can make API calls using the token. Once the Auth Code expires, you will need to generate a new one to continue accessing the APIs.
- Endpoint
POST {{baseUrl}}/api/v1/authentication/login
Description
This endpoint authenticates the client and returns an access token with specified permissions.
๐ฉ Request Headers
x-api-key string required
Content-Type string required
application/json๐ฆ Request Body Parameters
client_key string required
client_secret string required
email string required
- ๐งฉ Examples
- ๐งช Try It Out
Request Example
- cURL
- Python
- Java
- NodeJs
curl --location --request POST \
--url '{{baseUrl}}/api/v1/authentication/login' \
--header 'x-api-key: {{Shared X-API key By Zoqq}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"client_key": "{{ClientID}}",
"client_secret": "{{ClientSecret}}",
"email": "test@email.com"
}'
import requests
import json
url = "{{baseUrl}}/api/v1/authentication/login"
payload = json.dumps({
"client_key": "{{ClientID}}",
"client_secret": "{{ClientSecret}}",
"email": "test@email.com"
})
headers = {
'x-api-key': '{{Shared X-API key By Zoqq}}',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"client_key\": \"{{ClientID}}\",\n \"client_secret\": \"{{ClientSecret}}\",\n \"email\": \"test@email.com\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/api/v1/authentication/login")
.method("POST", body)
.addHeader("x-api-key", "{{Shared X-API key By Zoqq}}")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
const axios = require('axios');
let data = JSON.stringify({
"client_key": "{{ClientID}}",
"client_secret": "{{ClientSecret}}",
"email": "test@email.com"
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: '{{baseUrl}}/api/v1/authentication/login',
headers: {
'x-api-key': '{{Shared X-API key By Zoqq}}',
'Content-Type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response Example
- 200: Success
{
"code": 200,
"status": "success",
"message": "Access token generated successfully",
"data": [
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfa2V5IjoiMTIzIiwiY2xpZW50X3NlY3JldCI6WyIxMjMiXSwiZW1haWwiOiJ0ZXN0QGVtYWlsLmNvbSIsImlhdCI6MTc2MjE1MTQ0MiwiZXhwIjoxNzYyMTU1MDQyfQ.G4TmZ4sMJGg6VwnrgSPRel8ePPH6usDkqv3BU3vIbo0",
"expiry_time": 1762155042
}
]
}