Room Edit Channel Manager API
Technical documentation for the method that builds and sends booking data as JSON.
Summary
| Purpose | Send updated room capacity details from Channel Manager to the Allbookers API when a room is edited. |
| Entry Method | sendRoomchangesToAllbookers(SendRoomAllbookers sendRoomAllbookers) |
| Input | SendRoomAllbookers object in the request body. |
| Output | Boolean indicating success or failure. |
Description
This endpoint is used to load an existing Room entity from the database by its id and update its main capacity fields based on the values received in the SendRoomAllbookers request body. The method updates maximum_guests, totalRooms, adults, and children, then saves the modified Room through roomRepository.save(room). If the operation completes successfully, the method returns true. If any exception occurs during the process, the exception is caught and the method returns false.
Endpoint
Request
Content-Type: application/json
| Field | Type | Description |
|---|---|---|
| id | Long | Allbookers room ID to update. |
| qty | Integer | Total number of rooms. |
| MaxGuests | Integer | Maximum number of guests. |
| maxAdults | Integer | Maximum number of adults. |
| maxChildren | Integer | Maximum number of children. |
{
"id": 501,
"qty": 4,
"maxGuests": 3,
"maxAdults": 2,
"maxChildren": 1
}
Process
- The Room is fetched from the database using sendRoom.getId().
- maximum_guests is updated with maxGuests,
- totalRooms is updated with qty.
- adults is updated with maxAdults.
- children is updated with maxChildren.
- The updated room is saved to the database.
- Returns true on success, false if any exception occurs.
JSON Structure Sent
Content-Type: application/json
| Value | Description |
|---|---|
| true | Room updated successfully. |
| false | Room not found or update failed. |
Headers
- Content-Type: application/json
- Accept: application/json
Notes
- If the specified room does not exist, the operation may result in an exception due to the way the data is retrieved, and the method will return a failure response.
- The current implementation handles all errors in a generic way and returns only a Boolean result, without providing detailed information about the cause of the failure.
- No validation is performed to check for missing values or invalid numeric ranges before updating the room data.
- This endpoint is limited to updating specific room attributes, including maximum number of guests, total rooms, number of adults, and number of children.