API Reference · v1.0

General API

General-purpose option read/write mechanism: /get_option, /set_option, /set_string. The set of accessible options depends on the model.

1Overview

Most device settings are accessed through the general-purpose option read/write endpoints. Options are divided into two categories by value type — integer and string — each with its own endpoint:

EndpointPurposeValue Type
/get_optionRead the current value of a single optionInteger or string
/set_optionSet an integer-type optionInteger
/set_stringSet a string-type optionString

All three are protected endpoints and require logging in first to obtain a token (token) — see the Login API guide for details.

Always send value as a numeric type for integer options and as a string for string options; never mix the two. Limit options cannot be read or written and will return 400.

2Connection Information

ProtocolDefault PortBase URL
HTTP80http://<camera-ip>/
HTTPS443https://<camera-ip>/

The content type is application/json, and all endpoints must include the token:

Authorization: Bearer <access_token>

3Read an Option

POST/get_optionAuth required

Read the current value of a single option. The read type is determined by method: "Get" returns an integer, "GetString" returns a string.

Request Parameters

FieldTypeRequiredDescription
methodstringYes"Get" (integer) or "GetString" (string)
optionstringYesOption key

Request · Read an Integer Option

POST /get_option
Authorization: Bearer <access_token>
Content-Type: application/json

{ "method": "Get", "option": "<option_key>" }

Response · 200 OK

{ "code": 200, "msg": "ok", "data": 1 }

Request · Read a String Option

{ "method": "GetString", "option": "<option_key>" }

Response · 200 OK

{ "code": 200, "msg": "ok", "data": "<value>" }
data is the option value that was read: an integer read returns a number, a string read returns a string.

4Set an Integer Option

POST/set_optionAuth required

Set a single integer-type option. Some options are trigger-type (setting them performs an action); refer to each model's option documentation for usage.

Request Parameters

FieldTypeRequiredDescription
methodstringYesFixed value "Set"
optionstringYesOption key
valueintYesOption value (integer)

Request

POST /set_option
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "method": "Set",
  "option": "<option_key>",
  "value": 1
}

Response · 200 OK

{ "code": 200, "msg": "ok", "data": null }

5Set a String Option

POST/set_stringAuth required

Set a single string-type option (such as an IP address, name, etc.).

Request Parameters

FieldTypeRequiredDescription
methodstringYesFixed value "SetString"
optionstringYesOption key
valuestringYesOption value (string)

Request

POST /set_string
Authorization: Bearer <access_token>
Content-Type: application/json

{
  "method": "SetString",
  "option": "<option_key>",
  "value": "<value>"
}

Response · 200 OK

{ "code": 200, "msg": "ok", "data": null }
For security reasons, sys_admin_pwd cannot be set through this endpoint and will return 400; to change the password, use the dedicated endpoint.

6Option List (Per Model)

The accessible option keys, types, allowed values, and meanings depend on the model, each organized into a separate Option Spec. Select a model from the API List on the left, or open one from the table below:

ModelOption Spec
Each model's spec table is presented as a "Web UI feature ↔ API" mapping, covering the corresponding API Name, option name, and allowed values. The list is generated from the shared models.js, so it stays in sync with the API List.

7Responses and Error Codes

All responses use a unified JSON structure:

{ "code": <http_status>, "msg": "<message>", "data": <payload> }
codemsgMeaning
200okSuccess. data is the read value or null
400invalid paramsMissing required field, malformed format, or a limit/protected option (such as sys_admin_pwd)
401token malformed / failedToken missing, malformed, or not accepted
500unknown failRead or set failed on the device side