2.3 Replies to Requests
Replies to requests are mostly in the JSON format. Binary data download (user sounds, images, etc.) and intercom configuration requests are in XML. The Content-Type header specifies the response format. Three basic reply types are defined for JSON.
Positive Reply without Parameters
This reply is sent in case a request has been executed successfully for functions that do not return any parameters. This reply is always combined with the HTTP status code 200 OK.
{ "success" : true, }
Positive Reply with Parameters
This reply is sent in case a request has been executed successfully for functions that return supplementary parameters. The result item includes other reply parameters related to the function. This reply is always combined with the HTTP status code 200 OK.
{ "success" : true, "result" : { ... } }
Negative Reply at Request Error
This reply is sent in case an error occurs during request processing. The reply specifies the error code (code), text description (description) and error details if necessary (param). The reply can be combined with the HTTP status code 200 OK or 401 Authorisation Required.
{ "success" : false, "error" : { "code" : 12, "param" : "port", "description" : "invalid parameter value" } }
The table below includes a list of available error codes.
Code | Description | |
---|---|---|
1 | function is not supported | The requested function is unavailable in this model. |
2 | invalid request path | The absolute path specified in the HTTP request does not match any of the HTTP API functions. |
3 | invalid request method | The HTTP method used is invalid for the selected function. |
4 | function is disabled | The function (service) is disabled. Enable the function on the Services / HTTP API configuration interface page. |
7 | invalid connection type | HTTPS connection is required. |
8 | invalid authentication method | The authentication method used is invalid for the selected service. This error happens when the Digest method is only enabled for the service but the client tries to authenticate via the Basic method. |
9 | authorisation required | User authorisation is required for the service access. This error is sent together with the HTTP status code Authorisation Required. |
10 | insufficient user privileges | The user to be authenticated has insufficient privileges for the function. |
11 | missing mandatory parameter | The request lacks a mandatory parameter. Refer to param for the parameter name. |
12 | invalid parameter value | A parameter value is invalid. Refer to param for the parameter name. |
13 | parameter data too big | The parameter data exceed the acceptable limit. Refer to param for the parameter name. |
14 | unspecified processing error | An unspecified error occurred during request processing. |
15 | no data available | The required data are not available on the server. |
17 | parameter shouldn't be present | Parameter collision (it is impossible to write a specified parameter combination). |
18 | request is rejected | The request cannot be processed now and was rejected by the device. |
19 | file version is lower than minimum | The submitted file version is lower than required. |