Error Handling

The Cards API uses HTTP response status codes to indicate success or failure. When a request to our API is successful, we return an HTTP 200 response code. And when a request fails, we return an HTTP response codes 400 or 500

In summary:

  • 200 code means that the request was processed successfully
  • 400 code means that something was wrong with the data that you sent. For example, you might have missed some required parameters, or you might be sending invalid data.
  • 500 code means that something went wrong within our servers.

In all cases, the response will include an appropriate status code and the body of the response will include any additional details regarding the nature of the error.

Below examples show some of the errors that might occur, including the status code in the response header, and the json-formatted details in the response body.

// 400 bad request response due to duplicate requestId

HTTP/1.1 400 Bad Request
Content-Type: application/json
 
{
    "errorCode":"4188",
    "errorMessage":"RequestId already exist"
}

Common error codes

Error Code

Meaning

400

Bad Request – Your request is malformed or is missing some required parameter or contains some invalid data.

404

Not Found – You are attempting to access a resource that doesn’t exit. Check the url for your request.

500

Internal Server Error – We had a problem with our server. Try again later.

📘

Note

Always check the response body for details about the error.