Common Error Codes
There are 2 things that we need to handle in error case.One for human and the other for api consumer (machine) to interpret and take appropriate actions. For human, a proper readable error message can be returned. For machine, based on status code and “fields” that cause the error, it can highlight appropriate things in UI or take some other action.
Bulk Api error response example
Error scenario | Code | HTTP code | Example response (content of response_status object) |
Id or Name given in Input does not exist or not in use or user cannot set the value | 4001 | 400 | { "response_status": { "messages": [ { "status_code": 4001, "type": "failed", "message": "Value given for title is not valid" } ], "status": "failed" } } |
Forbidden / User not allowed to perform the operation | 4002 | 403 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4002, "type": "failed", "message": "User does not have this permission" } ], "status": "failed"4 } } |
Closure rule violation | 4003 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4003, "type": "failed", "message": "Closure rule violation. The following fields should be filled title" } ], "status": "failed" } } |
Internal Error (Exact error cannot be sent to user, like some Exception) | 4004 | 500 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4004, "type": "failed" } ], "status": "failed" } } |
Reference Exists. (Cannot delete an entity, because it is being used in another module) | 4005 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4005, "field": "id", "type": "failed" } ], "status": "failed" } } |
Invalid URL or Resource not founde.g., /requests/10 and if the request with id 10 not found | 4007 | 404 | { "response_status": { "messages": [ { "status_code": 4007, "type": "failed", "message": "Invalid URL" } ], "status": "failed" } } |
Not Unique | 4008 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4008, "field": "name", "type": "failed" } ], "status": "failed" } } |
Trying to edit non-editable field(value for certain fields can be given during add but cannot be edited e.g., status in_progress) | 4009 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4009, "field": "project_template", "type": "failed" } ], "status": "failed" } } |
Trying to edit internal field | 4010 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4010, "type": "failed", "message": "Trying to edit internal field: internal_name" } ], "status": "failed" } } |
No such field | 4011 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4011, "type": "failed", "message": "No field exists with the name field_name" } ], "status": "failed" } } |
Value for mandatory-field is not provided | 4012 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4012, "field": "title", "type": "failed" } ], "status": "failed" } } |
Unsupported Content Type | 4013 | 415 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4013, "type": "failed" } ], "status": "failed" } } |
Trying to edit read-only field | 4014 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4014, "field": "created_time", "type": "failed" } ], "status": "failed" } } |
API Rate Limit reached | 4015 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4015, "type": "failed" } ], "status": "failed" } } |
Already in Trash | 4016 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4016, "type": "failed", "message": "Request is already in trash" } ], "status": "failed" } } |
Not In Trash | 4017 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 4017, "type": "failed" } ], "status": "failed" } } |
Not allowed as per current license | 7001 | 400 | { "response_status": { "status_code": 4000, "messages": [ { "status_code": 7001, "type": "failed", "message": "Cannot perform the intended operation as per current license" } ], "status": "failed" } } |