To read the parameter property.
Request
- Urn: /api/prop
- Method: POST
- Request header: Cookie: session - actual session value.
- Request content: json
Json schema:
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "prop - request", "type": "object", "properties": { "param": { "type": "array", "items": { "type": "string", "pattern": "^[a-z_][a-z0-9_]*$" } } }, "required": [ "param" ], "additionalProperties": false }
Meaning of json items:
- $.param
Array with names of configuration parameters to retrieve parameter definitions. An empty array causes read all parameter definitions.
Example
- request for reading values of specific parameters: { "param": [ // request for reading values of specific parameters "sntp_enable", "sntp_server", "sntp_timeout", "sntp_period", "def_fw_version", "test_wr_only_param", "device_restart" ] } OR { // request for reading values for all existing parameters (empty array): "param": [] }
Response
- Response code:
- 200 – OK
- 400 – Error (bad request)
- 401 – Unauthorized
- 500 – Server error
- 512 - Internal application error
- Response header: Set-Cookie: session - Actual session value.
- Response type: json
Json schema:
{ "$schema": "http://json-schema.org/draft-07/schema#", "title": "set - response", "type": "object", "properties": { "status": { "type": "object", "additionalProperties": { "type": "string", "minLength": 1, "pattern": "^[a-z_][a-z0-9_]*$" } } }, "additionalProperties": false }
Meaning of json items:
- $.status:
List of unsaved parameter values.
Is present only for response with response code 400 – Bad request.
Type: object
Optional.- Format of list items: "<parameter_name>": "<error_status>"
<parameter_name> – name of reported parameter
<error_status> – type of error. - Possible values:
"undefined" – parameter not exists
"bad value" – parameter value is out of range
"bad type" – wrong type of parameter value
"access denied" – parameter is not accessible for write
"no memory" – not enough memory
"error" – general internal error
"busy" – device is in busy state (e.g. during the factory init process or upgrade process)
- Format of list items: "<parameter_name>": "<error_status>"
Example
{ "status": { "sntp_timeout": "undefined", "sntp_period": "bad value", "sntp_enable": "bad type", "dev_sn": "access denied" } }