Trigger gate actions from external systems. Use this endpoint to open, close, or toggle gates.
| Parameter | Type | Description |
|---|---|---|
| device_id required | string | The 6-character device ID of the gate |
| command required | string | One of: open, close, toggle |
{
"success": true,
"device_id": "A1B2C3",
"position": "opening",
"auto_close_in": 32
}
curl -X POST /api/command.php \
-H "Content-Type: application/json" \
-d '{"device_id": "A1B2C3", "command": "open"}'
Query the current status of a gate. Returns position, online status, and configuration.
| Parameter | Type | Description |
|---|---|---|
| device_id required | string | The 6-character device ID of the gate |
{
"device_id": "A1B2C3",
"name": "Main Entrance",
"gate_type": "double_leaf",
"online": true,
"position": "closed",
"auto_close_in": null,
"auto_close_time": 30,
"guard_hut": true,
"last_command": "2026-01-29T10:30:00+00:00"
}
| Value | Description |
|---|---|
closed |
Gate is fully closed |
opening |
Gate is in the process of opening |
open |
Gate is fully open |
closing |
Gate is in the process of closing |
curl -X POST /api/status.php \
-H "Content-Type: application/json" \
-d '{"device_id": "A1B2C3"}'
All endpoints return errors in the following format:
{
"error": true,
"message": "Description of the error"
}
| HTTP Status | Description |
|---|---|
400 |
Bad Request - Missing or invalid parameters |
404 |
Not Found - Device ID does not exist |
405 |
Method Not Allowed - Wrong HTTP method |
503 |
Service Unavailable - Gate is offline |
These are the currently configured gates in the simulator: