Error Responses

When a request to the REST API fails,

  • The HTTP response code is NOT 200,
  • An ERROR object is returned (when possible).

Response codes

Device errors

Response code 499 Device error denotes an error returned by the device itself.

In most situations, the ERROR object contains a message to explain the error.

Client errors

Response codes 4xx (but 499) denote an error that seems to have been cause by the client software.

Error code Explanation
400 Bad Request The request is malformed
401 Unauthorized An authentification of the client should be performed
403 Forbidden The client is authentified but not allowed to access this URL
404 Not Found The constant part of the URL does not exists
405 Method Not Allowed This request method is not supported for this URL
406 Not Acceptable The Accept headers sent in the request is not compliant with this URL
409 Conflict The target device is already locked by another request
410 Gone The {$id} part of the URL is not found
422 Unprocessable entity The data part of the request (JSON input namely) is invalid.

Service errors

Response codes 5xx denote a fatal error on the Companion Service side. The Companion Service is likely to terminate.

Error code Explanation
500 Internal Server Error The Companion Service has encountered an exception and is terminating.
503 Service Unavailable The Companion Service is still starting, or already stopping.