Error Codes
Response Codes
Room Mapping uses conventional HTTP response codes to indicate the success or failure of an API request. In general:
- Codes in the
200
OK range indicate success. - Codes in the
400
Bad Request,401
Unauthorized,403
Forbidden indicate an error that failed given the information provided. - Codes in the
500
Internal Server Error range indicate an error within our servers however these are rare.
Graceful Exception Handling
Our libraries raise exceptions for many reasons, such as parameters issues, authentication errors, and network unavailability.
We recommend writing code that gracefully handles all possible API exceptions.
HTTP Response Codes
Other standard HTTP errors may be generated by our stack and not directly from our API. Here are the categories of possible Standard HTTP response codes.
Code | Explnation | Type |
---|---|---|
1xx | Communication transfer protocol-level information. | Informational |
2xx | This indicates that the client's request was accepted successfully. | Success |
3xx | Indicates that the client must take some additional action to complete their request. | Redirection |
4xx | This category of error status codes points to the clients. | Client Error |
5xx | This category of error is related to server exceptions due to internal incapability to perform the request. The user is advised to contact the Room Mapping API Support team. | Server Code |
Error Response Body - Any response code within the 4xx
or 5xx
range will have a static response object alongside a relevant error message to aid the developer.
Error Codes
Besides the generic HTTP response codes, there are some room mapping specific errors to provide clarification over the 400 response.
Here are the details :
Error Code | Error |
---|---|
E4001 | Mandatory fields for hotel recognition are missing. |
E4002 | Hotel is not recognized. |
E4010 | More than {maxRatesCount} rates in one request |
E4020 | Room data does not contain a mandatory field. Each rate must include one of [RoomKey, RoomName, RateDescription]. |
Updated 6 months ago