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
| Parameter | Type | Required | Description |
|---|---|---|---|
| x-api-key | string | Yes | Shared X-API key provided by Zoqq |
| Content-Type | string | Yes | Must be application/json |
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| client_key | string | Yes | Client identification key |
| client_secret | string | Yes | Client secret key |
| string | Yes | Client's Email ID |
Request Examples
- cURL
- Java
- Python
- C#
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"
}'
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();
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)
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "{{baseUrl}}/api/v1/authentication/login");
request.Headers.Add("x-api-key", "{{Shared X-API key By Zoqq}}");
var content = new StringContent("{\n \"client_key\": \"{{ClientID}}\",\n \"client_secret\": \"{{ClientSecret}}\",\n \"email\": \"test@email.com\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response Example
- 200: Success
{
"code": 200,
"status": "success",
"message": "Access token generated successfully",
"data": [
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRfa2V5IjoiMTIzIiwiY2xpZW50X3NlY3JldCI6WyIxMjMiXSwiZW1haWwiOiJ0ZXN0QGVtYWlsLmNvbSIsImlhdCI6MTc2MjE1MTQ0MiwiZXhwIjoxNzYyMTU1MDQyfQ.G4TmZ4sMJGg6VwnrgSPRel8ePPH6usDkqv3BU3vIbo0",
"expiry_time": 1762155042
}
]
}