OTA_HotelResRQ
Alternative method to retrieve bookings from Kurzurlaub.de booking channel.
See also general information about the Reservation API in the developer guide and the standard message OTA_HotelResNotifRQ to read bookings.
Bookings are sent with status
| States | Description |
|---|---|
| Book | New bookings, this status is used only once when first sent, after that all further responses to a booking ID are always sent with status Modify |
| Modify | Booking changes or retrieval of a booking that has already been sent before via ResID_Value or by date range |
| Cancel | Cancellations |
OTA_HotelResRQ - Request via GET - REST-API
each method can be called via REST-API using GET. But this should only be done on bookings for development or testing purposes
General parameters used:
AgentDutyCode(optional if IP WhiteList or HTTP Basic Auth is used)HotelCode(mandatory)
Reading bookings with ReservationsId
Parameters used:
HotelReservationId(mandatory) a ReservationsId or comma separated IDsId(alternative to HotelReservationId)
GET /ota/api/HotelRes?AgentDutyCode=1&HotelCode=4&HotelReservationId=2129149
or comma separated ReservationsId`s
GET /ota/api/HotelRes?AgentDutyCode=1&HotelCode=4&HotelReservationId=2129149,2129150,2129151
Alternatively, you can also specify the entire ResID_Value (R12345678-A123456-1234, e.g. R2129149-A20540-4).
Read transactions with date range (date from/to)
Parameters used:
DateFromDateTo
A DateFormat (YYYY-MM-DD) or DateTimeFormat (YYYY-MM-DD(T)HH:MM:SS) is expected
delivers all bookings in the date range from/to (00:00:00 - 23:59:29) or with a specific time range
Example
GET /ota/api/HotelRes?AgentDutyCode=1&HotelCode=4&DateFrom=2022-01-01&DateTo=2022-02-01
or in DateTime format
Read postings with date (PurgeDate)
Parameter used:
PurgeDateExpected a DateFormat (YYYY-MM-DD)
delivers all bookings from the requested date
Example
GET /ota/api/HotelRes?AgentDutyCode=1&HotelCode=4&PurgeDate=2022-02-01
OTA_HotelResRQ - Request by POST
General parameters used:
@AgentDutyCode(agent ID): (optional)RequestorID@ID(Hotel ID): (mandatory)
Reading bookings with ReservationsId
Parameter used:
UniqueID@ID(mandatory) a ReservationsId
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelResRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="2.0">
<POS>
<Source AgentDutyCode="1">
<RequestorID ID="4" Type="4"/>
</Source>
</POS>
<!-- send booking for this ReservationId -->
<UniqueID Type="RES" ID="12345678" />
<HotelReservations>
<HotelReservation />
</HotelReservations>
</OTA_HotelResRQ>
Read postings with date (PurgeDate)
Parameter used:
HotelReservation@PurgeDateExpected DateFormat (YYYY-MM-DD)
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelResRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="2.0">
<POS>
<Source AgentDutyCode="1">
<RequestorID ID="4" Type="4"/>
</Source>
</POS>
<HotelReservations>
<!-- send all bookings after PurgeDate -->
<HotelReservation PurgeDate="2022-01-01" />
</HotelReservations>
</OTA_HotelResRQ>
Read new bookings
if no parameters are given, we deliver all new bookings that have never been sent. Attention: this only happens exactly once!
Parameters used:
- none
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelResRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="2.0">
<POS>
<Source AgentDutyCode="1">
<RequestorID ID="4" Type="4"/>
</Source>
</POS>
<!-- no params so send all unsubmitted bookings -->
<HotelReservations>
<HotelReservation />
</HotelReservations>
</OTA_HotelResRQ>
or easier
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelResRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="2.0">
<POS>
<Source AgentDutyCode="1">
<RequestorID ID="4" Type="4"/>
</Source>
</POS>
</OTA_HotelResRQ>
OTA_HotelResRS - versions of the response
The reservation data is output almost identical to the format the standard message
- OTA_HotelResNotifRQ - see more information about the output format
- Reservation API - general information in the developer guide
Notice:
If there are no reservations for the requested parameters, you will receive a response with a <Success/> (ie no errors have occurred in the parameters sent) and an empty <HotelReservations/> block.
Example: no reservations found
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelResRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" EchoToken="9c3561c0d9c534d355dd902ebae420d0" PrimaryLangID="de" TimeStamp="2022-02-04T12:13:13+01:00" Target="Production" Version="1.000">
<Success/>
<HotelReservations/>
</OTA_HotelResRS>
Error messages
If serious errors occur, e.g. in authentication, they are sent in an OTA_ErrorRS response with @ErrorCode and @ErrorMessage
See the standard message documentation for a list of common errors OTA_HotelResNotifRQ
Special note on format errors:
A special error message refers to the incorrect format of the parameters
DateFrom, DateTo or at PurgeDate
A DateFormat (YYYY-MM-DD) or DateTimeFormat (YYYY-MM-DD(T)HH:MM:SS) is expected
Example: ErrorMessage
<?xml version="1.0" encoding="UTF-8"?>
<OTA_ErrorRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" EchoToken="f3de3733d5095b49a5c774b99f467e57" PrimaryLangID="de" TimeStamp="2022-02-04T12:15:46+01:00" Target="Production" Version="1.000"
ErrorCode="500"
ErrorMessage="InternalError - Internal OTA Error: wrong format for param DateFrom (2022-02-01T15:30:00) or param DateTo (2022-02-01T16:45:0) in GET method ErrorRS (allowed format: YYYY-MM-DD or YYYY-MM-DD HH:MM:SS)"
/>