Error handling
HTTP status code
HTTP Status Codes and their meanings are as follows.
| HTTP Status Code | Description |
|---|---|
| HTTP Status Code | Description |
| 2xx | Success |
| 400 | BAD_REQUEST - the request is invalid |
| 401 | UNAUTHORIZED - API Token is not valid |
| 403 | FORBIDDEN - API Token is valid but no authorization |
| 404 | NOT FOUND - No resource |
| 5xx | SERVER ERROR - something wrong with Server |
Error response
When an error occurs (HTTP Status Code is not 2XX), the following Error Object should be delivered in JSON format.
Error object
| Description | |||
|---|---|---|---|
| Attributes | Type | Required | Description |
| errors | Object | ✅ | Server defined Error Code. |
| errors.name | String | ✅ | Error name |
| errors.message | String | ✅ | The error message that describes details of the error |
| errors.code | String | ✅ | The error code format in UPPERCASE |
| message | String | ✅ | A detailed explanation of the error code. errorMessage must be written in English. |
| statusCode | Number | ✅ | The response status code |
Sample error response
json
{
"errors": {
"name": "BadRequest",
"message": "Bad Request",
"code": "BAD_REQUEST"
},
"message": "Bad Request",
"statusCode": 400
}