Adonis.com REST Service V2.0

This web service is provided as a REST application.

You can find the documantation and the sample XMLs in the FTP area.



You need to request the following urls:

Search Available Hotels:

http://xmltest.adonis.com/AdonisServices/SearchHotels

Add Basket:

http://xmltest.adonis.com/AdonisServices/BasketHotels

Confirm Booking:

http://xmltest.adonis.com/AdonisServices/ConfirmHotels

Cancel Booking:

http://xmltest.adonis.com/AdonisServices/CancelHotels

Booking Details:

http://xmltest.adonis.com/AdonisServices/DetailHotels



You can test it on http://xmltest.adonis.com/AdonisServices

If you paste the Search Available Hotels Xml sample in the textarea, you can see the response. Param name is "prm_CurrentData"



Search Available Hotels XML REQUEST Sample

<?xml version="1.0" encoding="UTF-8"?>
<AdonisHotelSearchCriteriaDTO>
  <CheckInDate>20160720</CheckInDate>
  <CheckOutDate>20160723</CheckOutDate>
  <CityID>28674</CityID>
  <CountryID>162</CountryID>
  <NationalityCode>TR</NationalityCode>
  <PaginationData>
    <PageNumber>1</PageNumber>
    <ItemsPerPage>2</ItemsPerPage>
  </PaginationData>
  <RoomCriteria>
    <RoomCriteriaDTO>
      <AdultCount>1</AdultCount>
      <RoomCount>1</RoomCount>
      <ChildCount>0</ChildCount>
      <ChildAges />
    </RoomCriteriaDTO>
    <RoomCriteriaDTO>
      <AdultCount>2</AdultCount>
      <RoomCount>1</RoomCount>
      <ChildCount>0</ChildCount>
      <ChildAges />
    </RoomCriteriaDTO>
  </RoomCriteria>
  <Credentials>
    <ClientID>6a6a11cf-cd95-4bd9-9330-4582c8c5aac3</ClientID>
    <Username>europe@test.com</Username>
    <Password>test65_</Password>
  </Credentials>
</AdonisHotelSearchCriteriaDTO>


Search Available Hotels RESPONSE XML Sample

<?xml version="1.0" encoding="UTF-8"?>
<AdonisHotelSearchResultDTO xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Token>9d8ccca4-e8f3-4b62-be67-74599408b00b</Token>
  <PaginationData>
    <PageNumber>1</PageNumber>
    <ItemsPerPage>2000</ItemsPerPage>
  </PaginationData>
  <Errors />
  <AvailableHotel>
    <AvailableHotelDTO>
      <AvailableHotelItem>
        <AvailableHotelItemDTO>
          <FromDate>20160720</FromDate>
          <ToDate>20160723</ToDate>
          <AvailableHotelCount>1042</AvailableHotelCount>
          <Hotels>
            <HotelDTO>
              <HotelCode>423968</HotelCode>
              <HotelName>Rose Garden Suites</HotelName>
              <Currency>EUR</Currency>
              <Errors />
              <Status>Search</Status>
              <SupplierType>One</SupplierType>
              <AvailableRoom>
                <AvailableRoomDTO>
                  <HotelOccupancy>
                    <RoomCount>1</RoomCount>
                    <Occupancy>
                      <AdultCount>2</AdultCount>
                      <ChildCount>0</ChildCount>
                      <Passengers />
                    </Occupancy>
                  </HotelOccupancy>
                  <HotelRoom>
                    <HotelRoomDTO>
                      <AvailCount>1</AvailCount>
                      <HotelRoomUniqueNumber>
                        <XmlServicesUniqueNumber>bdcfd212-7a87-45c6-badc-00501a411dba</XmlServicesUniqueNumber>
                        <AdonisUniqueNumber>1f5c1529-5009-4652-b955-afbe875ddcb4</AdonisUniqueNumber>
                        <XmlServicesType>One</XmlServicesType>
                      </HotelRoomUniqueNumber>
                      <Board>
                        <Code>4ba9e39b-51ae-41f9-964b-b94f22b6c643</Code>
                        <Name>Bed and Breakfast</Name>
                      </Board>
                      <RoomType>
                        <Characteristic>DBL USE</Characteristic>
                        <Code>bdcfd212-7a87-45c6-badc-00501a411dba</Code>
                        <Name>DBL USE</Name>
                      </RoomType>
                      <Price>
                        <Amount>244,11</Amount>
                        <Currency>EUR</Currency>
                      </Price>
                    </HotelRoomDTO>
                  </HotelRoom>
              </AvailableRoomDTO>
          </AvailableRoom>
       </HotelDTO>
     </Hotels>
    </AvailableHotelItemDTO>
   </AvailableHotelItem>
  </AvailableHotelDTO>
 </AvailableHotel>
</AdonisHotelSearchResultDTO>


C# Example

Request in C# :

Note: The parameter name has to be prm_CurrentData

                var XmlString = "XML request string";
                string result = null;
                string postString = HttpUtility.UrlEncode("prm_CurrentData") + "=" + HttpUtility.UrlEncode(XmlString);
                byte[] postBytes = Encoding.ASCII.GetBytes(postString);
                HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create("http://xml.adonis.com/adonisservices/SearchHotels");
                webRequest.Method = "POST";
                webRequest.ContentType = "application/x-www-form-urlencoded";
                webRequest.ContentLength = postBytes.Length;
                webRequest.Headers["Accept-Encoding"] = "gzip, deflate";
                Stream postStream = webRequest.GetRequestStream();
                postStream.Write(postBytes, 0, postBytes.Length);
                postStream.Close();
                HttpWebResponse webResponse = (HttpWebResponse)webRequest.GetResponse();
                using (HttpWebResponse HttpWebResponse = (HttpWebResponse)webRequest.GetResponse())
                {
                    if (HttpWebResponse.ContentEncoding.ToLower().Contains("gzip"))
                    {
                        using (GZipStream decompress = new GZipStream(HttpWebResponse.GetResponseStream(), CompressionMode.Decompress))
                        using (StreamReader reader = new StreamReader(decompress))
                            result = reader.ReadToEnd();
                    }
                    else
                    {
                        using (StreamReader reader = new StreamReader(HttpWebResponse.GetResponseStream(), Encoding.UTF8))
                            result = reader.ReadToEnd();
                    }
                }

}

}