Error Handling
The API endpoints will respond with HTTP Status Codes. API responses will have appropriate status codes.
HTTP Status Codes
-
200: If an API endpoint responds with 200, it's a success.
-
204 (No Content): Indicates that a request has succeeded, but that the client doesn't need to navigate away from its current page.
-
400 (Bad Request): In this case, you can check the body of the response and find an error message that will help you investigate the problem further. It may be just an input data has issues.
-
401 (Unauthorized): In the event of a 401 response, which is related to authentication and entitlement, you need to make sure that you’re using the correct authorization info for the access.
-
403 (Forbidden): Accessing the resource you were trying to reach is forbidden.
-
404 (Not Found): The requested resource/entity was not found or it does not exist.
-
409 (Conflict): The request processing will create or has conflicting consequences.
-
412 (Precondition Failed): A precondition is not met, satisfied. This precondition has to be satisfied firstly.
-
422 (Unprocessable Entity): Status code means that the request cannot be processed. Some examples of such cases: the client account may have issues in its balance, security, administrative restriction, etc.
-
500: Typically means that something isn't working properly with the API.
In the event you receive errors, then check the body of the response, it usually includes a description of the problem.
The body of the error responses has the following schema:
{
"status": 100,
"timestamp": "2019-08-24T14:15:22Z",
"code": "string",
"message": "string",
"error": "string"
}