The Noonlight API uses conventional HTTP status codes to indicate success or failure. Responses with a status code starting with 4xx
or 5xx
can be considered as failed. The API returns errors in JSON format in following structure:
{
"code": 400,
"message": "Bad Request",
"details": "A required field is missing"
}
Developer-friendly API
Noonlight attempts to provide a developer-friendly API, hence sometimes you can find a hint on how to fix an error right in its details (like in the example above).
Attributes | Description |
---|---|
code | The HTTP status code of error returned. Can be: 2xx , 4xx or 5xx |
key | For API object errors, a short string from amongst those listed below describing the kind of error that occurred |
message | A human-readable message providing short description about the error |
details | A human-readable message providing more details about the error |
Key | Description |
---|---|
resource_not_found | Entity with provided id does not exist |
invalid_payload | A request body is invalid and cannot be processed |
alarm_canceled | The alarm has already been canceled and can no longer be modified |