OTA_ReadRQ
Method for retrieving 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_ReadRQ - 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/Read?AgentDutyCode=1&HotelCode=4&HotelReservationId=2129149
or comma separated ReservationsId`s
GET /ota/api/Read?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/Read?AgentDutyCode=1&HotelCode=4&DateFrom=2022-01-01&DateTo=2022-02-01
or in DateTimeFormat
GET /ota/api/Read?AgentDutyCode=1&HotelCode=4&DateFrom=2022-02-01T15:30:00&DateTo=2022-02-01T16:45:00
Read postings with date (PurgeDate)
Parameter used:
PurgeDateExpected a DateFormat (YYYY-MM-DD)
delivers all bookings from the requested date
Example
GET /ota/api/Read?AgentDutyCode=1&HotelCode=4&PurgeDate=2022-02-01
OTA_ReadRQ - Request via 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_ReadRQ 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_ReadRQ>
Alternative
<?xml version="1.0" encoding="UTF-8"?>
<OTA_ReadRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="2.0">
<POS>
<Source AgentDutyCode="1">
<RequestorID ID="4" Type="4"/>
</Source>
</POS>
<UniqueID Type="RES" ID="1513695" />
</OTA_ReadRQ>
Read transactions with date range (date from/to)
Is expected from the parameters
- a valid DatePeriod (
@Start-@End) - a valid DateFormat (YYYY-MM-DD) or DateTimeFormat (YYYY-MM-DD(T)HH:MM:SS)
Variant 1 - parameters used:
SelectionCriteria@Start(mandatory)SelectionCriteria@End(mandatory)
Example:
<?xml version="1.0" encoding="UTF-8"?>
<OTA_ReadRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="3.0">
<POS>
<Source AgentDutyCode="1">
<RequestorID ID="4" Type="4"/>
</Source>
</POS>
<ReadRequests>
<HotelReadRequest HotelCode="4">
<SelectionCriteria Start="2022-01-01" End="2022-01-30"/>
<!-- alternative DateTimeFormat
<SelectionCriteria Start="2022-01-27T11:30:00" End="2022-01-27T11:37:00"/>
-->
</HotelReadRequest>
</ReadRequests>
</OTA_ReadRQ>
Variante 2 - parameters used:
GlobalReservationReadRequest@Start(mandatory)GlobalReservationReadRequest@End(mandatory)
Example:
<?xml version="1.0" encoding="UTF-8"?>
<OTA_ReadRQ xmlns="http://www.opentravel.org/OTA/2003/05" Target="Production" Version="3.0">
<POS>
<Source AgentDutyCode="1">
<RequestorID ID="4" Type="4"/>
</Source>
</POS>
<ReadRequests>
<HotelReadRequest HotelCode="4"/>
<GlobalReservationReadRequest Start="2020-10-01" End="2020-11-30"/>
<!-- alternative DateTimeFormat
<GlobalReservationReadRequest Start="2022-01-27T11:30:00" End="2022-01-27T11:31:00"/>
-->
</ReadRequests>
</OTA_ReadRQ>
Read postings with date (PurgeDate)
is not offered in the OTA_ReadRQ message for POST requests because it is not intended according to the OTA specification.
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_ReadRQ 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_ReadRQ>
OTA_HotelResNotifRS - versions of the response
The reservation data is output in the same format and form 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 available
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelResNotifRS xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" EchoToken="5915874940c61a0f496dd31928e85672" PrimaryLangID="de" TimeStamp="2022-02-04T15:48:17+01:00" Target="Production" Version="1.000">
<Success/>
<HotelReservations/>
</OTA_HotelResNotifRS>
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)"
/>