Common Conventions
Response Format
Read Endpoints
Read endpoints (GET) typically return the business data object directly, without a code field. For example:
{
"sSerialNumber": "RC1126B-20240101-001",
"sFirmwareVersion": "V1.0.10"
}
Operation Endpoints
Operation endpoints (POST, PUT, DELETE) return an object containing code and message:
{
"code": 0,
"message": "success"
}
code=0 means success. A non-zero code indicates an error, and message provides a description.
Error Response
When a request fails, the device returns:
{
"code": 401,
"message": "Unauthorized: Invalid token or NO token provided"
}
Field Naming
JSON field names use camelCase. The first letter indicates the data type:
| Prefix | Type | Example |
|---|---|---|
i | Integer | iCpuUsage |
f | Float | fTemperature |
s | String | sSerialNumber |
b | Boolean | bRunning |
l | List | lDetection |
d | Object | dIpv4 |
URL Construction
CGI Endpoints
Most endpoints require the CGI base path:
http://<DEVICE_IP>/cgi-bin/entry.cgi/<API_PATH>
Direct Path Endpoints
Some endpoints bypass the CGI layer and are accessed directly:
http://<DEVICE_IP>/api/v1/device/serial-port
http://<DEVICE_IP>/api/v1/file?path=/mnt/sdcard/test.mp4
Authentication
With few exceptions (/system/key, /system/login, /system/check), all endpoints require the Token in the request header:
Cookie: token=<JWT_TOKEN>
See Authentication for how to obtain a Token.
Error Codes
Error codes are segmented by functional module:
| Prefix | Module |
|---|---|
100xx | Device & System |
200xx | Live View |
300xx | Recording |
400xx | AI Inference |
500xx | Terminal & Logs |
Common error codes:
| Code | Description |
|---|---|
10001 | Password too weak |
10002 | Token expired |
10003 | A firmware download is already in progress |
10004 | Port number out of range |
10005 | Port number already in use |
See Error Codes for the full list.
Technical Support and Product Discussion
Thank you for choosing our products! We are here to provide you with various support to ensure your experience with our products is as smooth as possible. We offer multiple communication channels to meet different preferences and needs.