Overview
When the server encounters an error processing any HTTPs API calls an HTTP error code is returned in the response and a detailed JSON object is returned (for some API calls and statuses).
Some commands have special error codes and messages, documented in the API Endpoints reference for each command, below are generic errors that can be returned by all API calls.
Handling the errors is dependent on the device implementation and requirements. The error table specifies which can be ignore, which should be retried and which require more complex handling.
Errors with the "None" handling correspond with errors that should be detected only during the development phase and should not happen in a production firmware.
Common errors
Unprocessable Entity | |
Error Code | 422 |
Example Message | { "error": "Invalid SN" } |
Description | One or more of the parameters passed to the command is invalid or the command cannot be executed at this stage. |
Suggested handling | None |
Not Found | |
Error Code | 404 |
Example Message | { "error": "Invalid SN" } |
Description | Resource not found. |
Suggested handling | None |
Unauthorized | |
Error Code | 401 |
Example Message | |
Description | The device authorization is no longer valid. |
Suggested handling | The device's UUID and Access Token should be removed from storage and the device should attempt to re-register with the provisioning server. |
Forbidden | |
Error Code | 403 |
Example Message | { "error": "Only allowed to set: inuse/removed/error" } |
Description | The requested state change is not allowed. |
Suggested handling | None |
Too Many Requests | |
Error Code | 429 |
Description | Too many requests sent to the server (rate limiting). |
Suggested handling | Pause the device communication with Xyte for a few seconds. |