Complete guide to integrating with ZktecoApi
Base URL: https://portal.zktecoapi.com/api/v1
Retrieve attendance records for a specific date range.
GET /attendance
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key |
string | Yes | String |
start |
string | Yes | Start date (YYYY-MM-DD HH:ii:ss) |
end |
string | Yes | End date (YYYY-MM-DD HH:ii:ss) |
[GET] https://portal.zktecoapi.com/api/v1/attendance?api_key=YOUR_API_KEY&start=2025-12-12 00:00:00&end=2025-12-12 23:59:59
{
"errors": null,
"data": [
{
"device_id": BAY00001111,
"user_id": "1",
"device_timestamp": "John Doe"
},
{
"device_id": BAY00001111,
"user_id": "2",
"device_timestamp": "Peter Snow"
}
],
"message": "Data retrive successful",
"version": "2.0.0",
"timestamp": 1764259080
}
{
"message": "Invalid Api Key",
"errors": [],
"data": null,
"version": "2.0.0",
"timestamp": 1764259080
}
| Message |
|---|
Invalid Api Key |
Subscription expired |
No active device found |
curl -X GET "https://portal.zktecoapi.com/api/v1/attendance?api_key=YOUR_API_KEY&start=2025-01-01 00:00:00&end=2025-01-31 23:59:59" \
-H "Content-Type: application/json"
fetch('https://portal.zktecoapi.com/api/v1/attendance?api_key=YOUR_API_KEY&start=2025-01-01 00:00:00&end=2025-01-31 23:59:59', {
method: 'GET',
headers: {
'Content-Type': 'application/json'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
import requests
url = "https://portal.zktecoapi.com/api/v1/attendance"
headers = {
"Content-Type": "application/json"
}
params = {
"api_key": "YOUR_API_KEY",
"start": "2025-01-01 00:00:00",
"end": "2025-01-31 23:59:59"
}
response = requests.get(url, headers=headers, params=params)
data = response.json()
print(data)
$url = "https://portal.zktecoapi.com/api/v1/attendance?api_key=YOUR_API_KEY&start=2025-01-01 00:00:00&end=2025-01-31 23:59:59";
$headers = [
"Content-Type: application/json"
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);