Error Handling
The following HTTP status codes are common for all RESTful TPP methods and indicate success:
| HTTP Status Code | Description |
|---|---|
| 200 | Success (in general) |
| 201 | New object has been successfully created |
| 204 | Operation has been successfully completed but there is no content to return |
Note that an HTTP response contains a special error object in the body if an error occurred during request processing. An error object has the following structure:
| Field Name | Field Type | Field Description |
|---|---|---|
| code | JSON string | HTTP status code. |
| type | JSON string | Error code: a more detailed code that describes the cause of an error. |
| message | JSON string |
Human-readable description of an error. WARNING: The exact format of error descriptions might change. Please do not consider error descriptions as final and static. |
| details | JSON string |
Additional details about an error. It might contain identifiers, logins, names, and so on. This field is optional. WARNING: The exact format of error details might change. Please do not consider error details as final and static. |
All error codes can be divided into the following ranges:
- 6001-6100: Error codes related to failed basic preconditions such as missed Content-Length header or when a client does not accept the GZIP encoding.
- 6101-6200: Error codes related to system failures.
- 9001-14000: Error codes related to absent or empty query string parameters or JSON object fields.
- 14001-19000: Error codes related to invalid data in query string parameters or JSON object fields.
- 19001-24000: Error codes related to conflicts in query string parameters or JSON object fields.
- 24001-32767: Error codes related to various business logic errors, such as: an object is not found, a certain key does not support a specific operation, and so on.
See the full list of error codes in Error Codes.