The error response message includes a unique error code for the endpoint, an HTTP response message, and an HTTP response code. When enabled, the response contains HATOAS links.
Example response
{
"error": {
"code": "not_found",
"message": "Listing was not found or expired, provided UUID: d3bfa3e1-e",
"http_code": 404
},
"links": [
{
"method": "GET",
"rel": "docs",
"href": "https://bmglabsapi.docs.apiary.io/#reference/products/product"
}
],
"timestamp": "2018-08-02T16:43:33.184+08:00"
}
List of response codes and sample messages.
General | ||
http status |
API error Code |
Message (example) |
---|---|---|
400 | error | |
400 | invalid_params | City not found, provided UUID: ...' |
401 | GEN-UNAUTHORIZED | Unauthorized |
404 | not_found | Listing was not found or expired, provided UUID: ... |
410 | gone | Product is no longer available |
500 | internal_error | internal_error_default |
/bookings | ||
400 | malformed_json | JSON processing result: ... |
400 | invalid_params | Disallowed parameters provided |
403 | insufficient_balance | Wallet balance too low to create a booking. Current balance: ... |
404 | upload_failed | Uploded file is too big |
404 | upload_failed | No upload content |
409 | invalid_action | Booking does not have a `reserved` status. You cannot confirm this booking: ... |
409 | invalid_action | Booking has status waiting. You cannot request cancellation until aproved. |
409 | invalid_action | Booking is already cancelled. You cannot cancel this booking again: ... |
422 | invalid_data | Arrival date is unavailable. Please choose another one. |
422 | no_product | ProductType not found, UUID: ... |
422 | no_product | Number of elements in 'perPax' array must be equal to number of guests. |
422 | no_product | Product is not available for booking via API |
422 | prices_mismatch | Arrival date is not available anymore. Please choose another one. |