Retrieve property attributes¶
Use /ota/OTA_HotelSearch to retrieve the attributes of one or more Property.
Request¶
HTTP request¶
POST https://supply-xml.booking.com/hotels/ota/OTA_HotelSearch
Request body¶
Provide an OTA_HotelSearchRQ object in the request body. Example:
<OTA_HotelSearchRQ xmlns="http://www.opentravel.org/OTA/2003/05" Version="2.001">
<Criteria>
<Criterion>
<!-- Replace the {PlaceHolder} in the following line! -->
<HotelRef HotelCode="{PropertyID}"/>
</Criterion>
</Criteria>
</OTA_HotelSearchRQ>
Alternatively, omit Criteria to retrieve the statuses of all properties that are assigned to the used machine account. Consider using Pagination in this case.
Response¶
The response contains an OTA_HotelSearchRS object:
<OTA_HotelSearchRS
xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelSearchRS.xsd" TimeStamp="2015-12-02T15:07:34-00:00" Target="Production" Version="3.000">
<Properties LastChange="2015-12-01 12:00:00">
<Property HotelCode="{PropertyID}" HotelName="The Best Hotel" CurrencyCode="EUR">
<TPA_Extensions HotelStatus="XML: Being built" Created="2015-11-19 07:13:06" LastChange="2015-12-01 16:41:53" ContentScore="67" ConnectionStatus="XML Active">
<Connections>
<Connection ConnectionType="Reservations" ConnectionState="XML Active" />
<Connection ConnectionType="Rates and Availability" ConnectionState="XML Active" />
<Connection ConnectionType="Content" ConnectionState="XML Active" />
</Connections>
</TPA_Extensions>
</Property>
</Properties>
</OTA_HotelSearchRS>
ContentScore is calculated periodically. It may take a while for your changes to reflect on the score.
Connections¶
The Connections
array contains information about connection types and their current status.
This functionality is not enabled by default. Enable hotel_search_include_connections
feature in Provider Portal in order to use it.
ConnectionState
can contain the following values:
- Pending Connection - Connection is pending on provider side
- Pending Property - Connection is pending on property side
- XML Active - Connection is active
Pagination¶
Because the amount of properties can be big, retrieving all of them at once can cause issues. Therefore you can request properties in batches by adding the TPA_Extensions
->Pagination
object to the request body.
Pagination
element expects 2 parameters:
- Page - number of requested page
- PageSize - amount of elements per page. We recommend using 100 as PageSize.
Pagination
element outputs 4 parameters:
- TotalAmount - total number of hotels found
- Page - number of requested page
- PageSize - size of the page
- PageCount - total amount of pages of current
PageSize
NOTE: You can only use one parameter at a time, so Pagination OR Criteria.
NOTE: Results are sorted in ascending order of HotelCode.
Pagination - Request Example¶
<OTA_HotelSearchRQ xmlns="http://www.opentravel.org/OTA/2003/05" Version="2.001" >
<TPA_Extensions>
<Pagination Page="1" PageSize="100"/>
</TPA_Extensions>
</OTA_HotelSearchRQ>
Pagination - Response Example¶
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelSearchRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opentravel.org/OTA/2003/05 OTA_HotelSearchRS.xsd" TimeStamp="2019-12-23T14:18:06+00:00" Target="Test" Version="3.000">
<TPA_Extensions>
<Pagination TotalAmount="3500" PageCount="35" Page="1" PageSize="100"/>
</TPA_Extensions>
<Properties>
<Property HotelCode="{PropertyID}" HotelName="The Best Hotel" CurrencyCode="EUR">
<TPA_Extensions HotelStatus="XML: Being built" Created="2015-11-19 07:13:06" LastChange="2015-12-01 16:41:53" ContentScore="67" ConnectionStatus="XML Active">
<Connections>
<Connection ConnectionType="Reservations" ConnectionState="XML Active" />
<Connection ConnectionType="Rates and Availability" ConnectionState="XML Active" />
<Connection ConnectionType="Content" ConnectionState="XML Active" />
</Connections>
</TPA_Extensions>
</Property>
...
<Property HotelCode="{PropertyID}" HotelName="The Best Hotel 2" CurrencyCode="EUR">
<TPA_Extensions HotelStatus="XML: Being built" Created="2015-12-15 03:23:01" LastChange="2016-12-01 16:41:53" ContentScore="68" ConnectionStatus="Pending Property"/>
<Connections>
<Connection ConnectionType="Content" ConnectionState="Pending Property" />
</Connections>
</Property>
</Properties>
</OTA_HotelSearchRS>