Error Handling
The Cisco Business Dashboard API provides status and error information using HTTP status codes with a response payload in JSON format. Status codes are chosen to be appropriate for the condition, and the response payload with typically provide both error type information suitable for programmatic consumption as well as a meaningful error message appropriate for presentation to a user.
HTTP Status Codes
The Cisco Business Dashboard API always returns sensible HTTP status codes. Error conditions are reported as one of the following classes:
- 1xx: Informational - Communicates transfer protocol-level information.
- 2xx: Success - Indicates that the client’s request was accepted successfully.
- 3xx: Redirection - Indicates that the client must take some additional action in order to complete their request.
- 4xx: Client Error - This category of error status codes points the finger at clients.
- 5xx: Server Error - The server takes responsibility for these error status codes.
Error Representations
Error responses contain a JSON payload with the following elements:
- An error message with human readable content suitable for presentation to a user.
- A unique error type identifying the error.
- Optional 'error-data' content with additional information that expands on the error or can be used to correlate the error with other events and logs.
An example error payload is shown below:
{
"error-code": "bad-jwt-signature",
"error-message": "Bad JWT signature",
"error-data": []
}