MEDIA API
Get Property Images API
Technical documentation for the method that builds and sends booking data as JSON.
Summary
| Purpose | Retrieve the images of a property from the database and send them as a list of paths to Channel Manager. |
| Entry Method | POST /getApiPropertyImages |
| Input | propertyId as an object in the request body. |
| Output | A PropertyImages object containing the list of image URLs. |
Description
This endpoint is used to retrieve all images associated with a specific room, build the full URLs by prepending the base https://allbookers.com, and return them as a list of strings inside a RoomImages object.
Endpoint
POST
/getApiPropertyImages
Request
Content-Type: application/json
Authorization: Bearer <token>
| Field | Type | Description |
|---|---|---|
| propertyId | Long | Property identifier |
Request Body Example
{
"propertyId": 12
}
Process
- The Property is fetched from the database using propertyId.
- All HotelPhoto entries of the property are iterated.
- For each photo, the imagePath is collected and stored in a list.
- The list is placed inside a PropertyImages object and returned as the response.
JSON Structure Sent
| Field | Type | Description |
|---|---|---|
| propertyImagesPath | Array of String | List of image paths for the property. |
Example JSON Sent
{
"propertyImagesPath": [
"/images/property101/photo1.jpg",
"/images/property101/photo2.jpg"
]
}
Headers
Content-Type: application/jsonAccept: application/json
Example Response
{
"success": true,
"message": "Properties imported successfully"
}
Notes
- If the specified property identifier does not exist in the database, the operation may result in an exception due to the way the data is retrieved. A controlled error-handling approach is recommended to handle this scenario more safely.
- In this endpoint, paths are stored and returned as they are, without adding a base URL. It is important to ensure that this behavior is intentional and consistent with how the data is expected to be used on the Channel Manager side.