Roadmap - Erste Schritte zur Verwendung der OTA REST-API
Vorarbeiten und Ablauf
- Channelmanager ist angelegt und hat eine ID (AgentDutyCode)
- TestHotel ist angelegt / Channelmanager im Hotel gesetzt (HotelCode)
- Eintrag für HTTP Basic Auth des Agent ist erfolgt
- IPs in der IP-WhiteList ggf. hinterlegt
siehe Wiki: Roadmap zur Anbindung neuer Partner > Phase 2 – Entwickung / Development & certification > Schritt 1: Account Erstellung
Test der Authentifizierung und Verbindung
am schnellsten geht der Test der Authentifizierung und der Verbindung zum OTA Dienst über die REST-API und ein Ping
- Endpunkt für alle POST Requests: https://www.kurzurlaub.de/ota/api/
- Endpunkt für GET Requests:
https://www.kurzurlaub.de/ota/api/<MessageName>?<ParamName>=<ParamValue> - Endpunkt für Ping https://www.kurzurlaub.de/ota/api/Ping?HotelCode=1 (HotelCode anpassen)
Test der Verbindung mit Ping (GET Request)
Ping - GET Request (OTA_PingRQ)
Die Anfrage an den Dienst per GET Request (Message: OTA_PingRQ)
Beispiel Endpunkt:
GET https://www.kurzurlaub.de/ota/api/Ping?HotelCode=1 (HotelCode anpassen)
sollte, sofern alles ok ist, als Response (Message: OTA_PingRS) ein <Success/> liefern.
Ping - Response (OTA_PingRS)
Als Antwort / Response (Message: OTA_PingRS) wird ein <Success/> erwartet.
Beispiel:
<OTA_PingRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="22150049012a2c4118ad45713703189f" PrimaryLangID="de"
TimeStamp="2021-12-01T12:12:25+01:00" Target="Production" Version="1.000">
<Success/>
<EchoData>online</EchoData>
</OTA_PingRS>
Mögliche Fehler mit ErrorCode und ErrorMessage:
Agent nicht online oder freigeschaltet
- ErrorCode: 400
- ErrorMessage: AuthenticationError - Authentication failed - Agent is not online (AgentDutyCode xx)
<OTA_ErrorRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="fedfab716458725ea20a67944e583b1f"
PrimaryLangID="de"
TimeStamp="2021-12-01T12:03:41+01:00"
Target="Production" Version="1.000"
ErrorCode="400"
ErrorMessage="AuthenticationError - Authentication failed - Agent is not online"/>
Falsche oder fehlende GET Parameter
- ErrorCode: 104
- ErrorMessage: InternalError - Empty HotelCode (HotelCode) in accepted params (agentdutycode, hotelcode, hotelreservationid, uniqueid)
Beispiel: https://www.kurzurlaub.de/ota/api/Ping (keine Parameter)
Beispiel: https://www.kurzurlaub.de/ota/api/Ping?HotelCodeParam=1 (falscher Parameter)
<OTA_ErrorRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="f3f89dac94f77065a5d32eb840a00a95"
PrimaryLangID="de" TimeStamp="2021-12-01T12:06:55+01:00"
Target="Production" Version="1.000"
ErrorCode="104"
ErrorMessage="InternalError - Empty HotelCode (HotelCode) in accepted params
(agentdutycode, hotelcode, hotelreservationid, uniqueid)"/>
Falscher HotelCode / HotelCode nicht gefunden
Beispiel: https://www.kurzurlaub.de/ota/api/Ping?HotelCode=1000000 (keine Parameter)
- ErrorCode: 211
- ErrorMessage: HotelNotActivated - Hotel not found (HotelCode 1000000 / AgentDutyCode 1)
Beispiel: https://www.kurzurlaub.de/ota/api/Ping?HotelCode=2 (falscher HotelCode)
- ErrorCode: 210
- ErrorMessage: HotelNotLinked - Hotel (HotelCode xxxx) linked to another channel manager (your AgentDutyCode is xx)
<OTA_ErrorRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="e20b6ab9e9a6dedb0fc7a70fd2453327" PrimaryLangID="de"
TimeStamp="2021-12-01T12:10:57+01:00" Target="Production" Version="1.000"
ErrorCode="210"
ErrorMessage="HotelNotLinked - Hotel (HotelCode xxxx) linked to another channel manager
(your AgentDutyCode is xx)"/>
Test der Verbindung mit Ping (POST Request)
Ping - POST Request (OTA_PingRQ)
Die Anfrage an den Dienst per POST Request (Message: OTA_PingRQ)
Beispiel: Endpunkt (nur für Ping erlaubt):
POST https://www.kurzurlaub.de/ota/api/Ping
Beispiel: allgemeiner Endpunkt (für alle Messages erlaubt):
POST https://www.kurzurlaub.de/ota/api
Beispiel XML Request: (bitte AgentDutyCode, RequestorID und HotelCode anpassen)
<?xml version="1.0" encoding="UTF-8"?>
<OTA_PingRQ EchoToken="1" PrimaryLangID="de" Target="Production" TimeStamp="" Version="1.0">
<POS>
<Source AgentDutyCode="1">
<RequestorID ID="1" Type="4"/>
</Source>
</POS>
<EchoData>Are you there</EchoData>
</OTA_PingRQ>
Ping - Response (OTA_PingRS)
Es wird ein <Success/> erwartet.
Beispiel:
<OTA_PingRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="22150049012a2c4118ad45713703189f"
PrimaryLangID="de" TimeStamp="2021-12-01T12:12:25+01:00" Target="Production" Version="1.000">
<Success/>
<EchoData>online</EchoData>
</OTA_PingRS>
Mögliche Fehlerquellen:
Es ist nicht möglich, Anfragen an falsche REST-API Endpunkte zu senden (verwenden Sie dann den allgemeinen Endpunkt).
Beispiel:
<?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="ed1e968d6ef00892b3b08fda80e54dab" PrimaryLangID="de"
TimeStamp="2021-12-01T11:51:11+00:00"
Target="Production" Version="1.000"
ErrorCode="550"
ErrorMessage="CustomError - RequestMessage (OTA_PingRQ) and Endpoint (OTA_ErrorRQ) not match."/>
Weitere REST-API Methoden
HotelRatePlan
Der Endpunkt HotelRatePlan liefert eine Liste der verfügbaren Zimmer und Angebote in Kombination.
HotelRatePlan - GET Request (OTA_HotelRatePlanRQ)
Beispiel Endpunkt: https://www.kurzurlaub.de/ota/api/HotelRatePlan?HotelCode=1
HotelRatePlan - POST Request
Die Anfrage an den Dienst per POST Request (Message: OTA_HotelRatePlanRQ)
Beispiel: Endpunkt (nur für HotelRatePlan erlaubt):
POST https://www.kurzurlaub.de/ota/api/HotelRatePlan
Beispiel: allgemeiner Endpunkt (für alle Messages erlaubt):
POST https://www.kurzurlaub.de/ota/api
Beispiel XML Request: (bitte AgentDutyCode, RequestorID und HotelCode anpassen)
<?xml version="1.0" encoding="UTF-8"?>
<OTA_HotelRatePlanRQ xsi:schemaLocation="http://opentravel.org/2010A/OTA_HotelRatePlanRQ.xsd"
EchoToken="938a6a32-c526-485b-b641-f69d635cda41"
TimeStamp="2011-11-23T09:44:06" Version="1.001"
xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLXSchema-instance">
<POS>
<Source AgentDutyCode="1">
<RequestorID ID="1" Type="4"/>
</Source>
</POS>
<RatePlans>
<RatePlan>
<HotelRef HotelCode="1"/>
</RatePlan>
</RatePlans>
</OTA_HotelRatePlanRQ>
HotelRatePlan - Response (OTA_HotelRatePlanRS)
Der Endpunkt HotelRatePlan liefert eine Liste der verfügbaren Zimmer und Angebote in Kombination
- verfügbare Zimmer (SellableProduct + InvCode)
<SellableProduct InvCode="50931" InvType="ROOM"> - verfügbare Angebote (RatePlan)
<RatePlan RatePlanID="404915" RatePlanCode="TEST-BAR"> - Kombination RatePlan + Zimmer
<Rate Start="2021-12-01" End="2024-12-01" InvCode="50931">
Beispiel
<OTA_HotelRatePlanRS xmlns="http://www.opentravel.org/OTA/2003/05"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
EchoToken="1b8636022223b53117efb6c9a0b51afb"
PrimaryLangID="de" TimeStamp="2021-12-01T12:21:33+01:00" Target="Production" Version="1.000">
<Success/>
<RatePlans HotelCode="1">
<RatePlan RatePlanID="404915" RatePlanCode="TEST-BAR">
<DestinationSystemsCode/>
<Description Name="Testangebot 2 Nächte RezExchange OTA - bitte nicht buchen!">
<Text>Kurzurlaub Angebot 2 ÜN gültig bis 01.12.2024</Text>
</Description>
<Rates>
<Rate Start="2021-12-01" End="2024-12-01" InvCode="50931">
<BaseByGuestAmts>
<BaseByGuestAmt AmountAfterTax="119.00" CurrencyCode="EUR"/>
</BaseByGuestAmts>
</Rate>
<Rate Start="2021-12-01" End="2024-12-01" InvCode="50932">
<BaseByGuestAmts>
<BaseByGuestAmt AmountAfterTax="115.00" CurrencyCode="EUR"/>
</BaseByGuestAmts>
</Rate>
</Rates>
<SellableProducts>
<SellableProduct InvCode="50931" InvType="ROOM">
<GuestRoom Code="50931" RoomTypeName="Doppelzimmer (18m², ID:50931, 2E/2K)"
Quantity="10"/>
</SellableProduct>
<SellableProduct InvCode="50932" InvType="ROOM">
<GuestRoom Code="50932" RoomTypeName="Einzelzimmer (16m², ID:50932, 1E/0K)"
Quantity="4"/>
</SellableProduct>
</SellableProducts>
</RatePlan>
</RatePlans>
</OTA_HotelRatePlanRS>
Mögliche Fehler mit ErrorCode und ErrorMessage:
Eine Liste der möglichen Fehler findet man in der Übersicht der ErrorCodes
Mögliche allgemeine Fehler für das Hotel sind:
- Hotel is not active
- Hotel is not linked to this Channel Manager
- Hotel is not activated for Channel Manager
- Hotel is not online (account deactivated)
Mögliche Fehler für diese Anfrage zu Zimmer und Angeboten:
- Hotel does not have rooms created or configured
- Hotel does not have rates created or configured
Next steps
Wir überarbeiten gerade unsere online Dokumentation als Wiki für alle Methoden und Endpunkte, die ErrorCodes und die Roadmaps, bitte haben Sie noch ein paar Tage geduld.
We are currently revising our online documentation as a wiki for all methods and endpoints, the ErrorCodes and the roadmaps, please be patient for a few more days.