Skip to main content

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:

PrefixTypeExample
iIntegeriCpuUsage
fFloatfTemperature
sStringsSerialNumber
bBooleanbRunning
lListlDetection
dObjectdIpv4

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:

PrefixModule
100xxDevice & System
200xxLive View
300xxRecording
400xxAI Inference
500xxTerminal & Logs

Common error codes:

CodeDescription
10001Password too weak
10002Token expired
10003A firmware download is already in progress
10004Port number out of range
10005Port 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.

Loading Comments...