API Errors and Status Code Definitions
Business Health applies the industry-recognized policies regarding HTTP status codes stated in RFC 2616, which also defines the Status-Line syntax as shown below:
Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF
The following status code categories are outlined in the HTTP specification and are used to convey the results of a client's request:
- 2xx: Success – Indicates that the client's request was accepted successfully.
- 3xx: Redirection – The client must take additional action to complete their request.
- 4xx: Client Error – Indicates a problem with the client's request.
- 5xx: Server Error – Indicates a problem on the server side.
If the API call fails, the server returns an error message with the appropriate status code.
HTTP Response Codes
| CODE | MEANING | DESCRIPTION |
|---|---|---|
| 200 | OK | The request was successful. |
| 201 | Created | The request succeeded in creating a new resource due to the POST or PUT request. |
| 204 | No Content | This is a response to a successful request that will not return a body (e.g., a DELETE request). |
| 400 | Bad Request | The server will not process the request due to a client error (e.g., bad request syntax, invalid message framing, or incorrect request routing). |
| 401 | Unauthorized | The request will not be processed unless the client authenticates the right way. |
| 402 | Payment Required | Your current license does not include this functionality |
| 403 | Forbidden | The client does not have access rights to the content (unauthorized). Unlike 401 Unauthorized, the server knows the client's identity. |
| 404 | Not Found | The server cannot find the requested resource. |
| 405 | Method Not Allowed | The server knows the request method but it isn't supported by the target resource (e.g., DELETE). |
| 415 | Unsupported Media Type | The server does not support the media format of the requested data. |
| 422 | Unprocessable Content | The server is unable to process a request because it contains semantic errors or does not meet certain conditions (e.g., the input password matches one in a password log counter). |
| 500 | Internal Server Error | The server has encountered a situation it does not know how to handle. |
| 501 | Not Implemented | The requested functionality is not implemented |
| 504 | Gateway Timeout | When a server acts as a gateway and cannot get a response in time. |