Appearance
Error Handling
HTTP Status Codes and JSON Fields
All of Manheim's modern APIs return standard HTTP status codes and, as appropriate, JSON objects with additional information in fields such as message and developerMessage.
The following table lists some of the more common HTTP codes that may be returned, along with the standard description that applies beyond the context of Manheim's APIs.
| Code | Description |
|---|---|
| 2XX | SUCCESS |
| 200 | OK |
| 201 | Created |
| 202 | Accepted |
| 204 | No Content |
| - | - |
| 4XX | CLIENT ERROR |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
| 404 | Not Found |
| 406 | Not Acceptable |
| 415 | Unsupported Media Type |
| - | - |
| 5XX | SERVER ERROR |
| 500 | Internal Server Error |
The detailed meaning of each return code will vary depending on the specific method being called.
Details on return codes for a specific API and its endpoints can be found in the API Reference page for that API.
Examples
Suppose an API consumer attempted to retrieve an inventory unit using an ID that did not correspond to any unit currently in the system. The system would return the following 404 NOT FOUND error and JSON object.
404
X-Manheim-Media-Type: manheim.v1
{
"errors": [
{
"property": "",
"message": "Unit not found.",
"developerMessage": "Resource Unit not found."
}
]
}If an API consumer attempted to update an inventory unit by changing a field that cannot be updated, the system would return the following 400 BAD REQUEST error and JSON object. The property field in the returned JSON object indicates which field in the original JSON object caused the error.
400
X-Manheim-Media-Type: manheim.v1; format=json
{
"errors": [
{
"property": "Type",
"message": "Can not update Type field for Unit",
"developerMessage": "Can not update Type field for Unit"
}
]
}