TRXA Device Sync API Reference & Code Examples
Retrieve pending commands for a specific device. Note: Commands are automatically marked as "sent" upon fetching. No separate acknowledgment request is required.
| Parameter | Type | Required | Description |
|---|---|---|---|
SN |
String | Yes | Device Serial Number (e.g., AIOR123456) |
Receive real-time attendance punch logs. Expects a JSON payload in the request body.
| Parameter | Type | Required | Description |
|---|---|---|---|
logs |
Array | Yes | Array of attendance log objects |
↳ serial_number |
String | Yes | Device Serial Number |
↳ employee_id |
String | Yes | ID of the employee |
↳ timestamp |
String | Yes | Punch time (Format: YYYY-MM-DD HH:MM:SS) |
Logs are sent as a POST request to your configured API URL with the following JSON body:
{
"logs": [
{
"employee_id": "EMP001",
"timestamp": "2024-01-15 09:30:00",
"serial_number": "ABC123456"
},
{
"employee_id": "EMP002",
"timestamp": "2024-01-15 09:32:00",
"serial_number": "ABC123456"
}
]
}
Logs are sent in batches of up to 20 at a time. After successfully saving, respond with allok.
Use these ready-made scripts to test the API endpoints or build your own ZKTeco device simulator.
/api/pending.php endpoint automatically marks all fetched commands as status = 'sent'. There is no need to make a secondary POST request to acknowledge them.
uid mapping internally. Sync clients only need to process the user_id (String).
/api/receive_log.php endpoint must respond with allok after successfully receiving logs. Any other response will cause the system to treat the batch as failed and retry sending.