Sletat Ru Provider API

Материал из wiki.Sletat.ru
Перейти к: навигация, поиск

Service Description

In order to integrate with SLETAT.RU you need to create a web service that will perform the following tasks:

  • Unload directories: cities of departure, countries, resorts, hotels, etc.
  • Implement parameterized price search
  • Actualize the selected tour by its ID

For simplicity, the service can be made as a web page that accepts GET or POST parameters and returns the answer in XML (not SOAP) format

The same address should be used for all methods of the web service. For example, if you implement the service at: http://mysite.com/services/sletatru.xml , then this address must remain the same for all requests.

For example: :

The results should be presented in XML. Described format should be applied for each method in the document.

Version attribute indicating the version of the protocol should be specified for the root element in the result. The attribute is needed to determine the version of the tour provider with SletatRu service.

Example:

<getCountriesResult version="1.0">
...
</getCountriesResult> 

This document describes 1.0 version of the protocol.

All methods should return XML in UTF-8.

All parameters, that are not marked as "required", are optional for the client side only. It is mandatory to process all the parameters for the server side.

The result of the request should match to the specified parameters strictly.

Pool of IP addresses, from which the service SletatRu communicates the realized tour provider, is provided separately. Для его уточнения необходимо написать на support@sletat.ru

Additional Requirements to the Service

Maximum time of work with any executed method of service should not exceed 30 seconds, the recommended response time (including the tour booking method) is up to 5 seconds. If any method takes longer than 30 seconds to return the results, SletatRu will not process the data.

Any method of the service can be called simultaneously by different threads. Therefore, in realization of the methods, there should not be locks which synchronize access to the methods. The tour booking method must support simultaneous execution of multiple search queries.

The number of queries per day can be determined separately and depends on the following parameters:

  • the number and popularity of the tour operator’s destinations
  • the number of departure cities
  • the number of search queries in SletatRu service.

Methods to Be Realized

The following elements have been specified in the document for each method: purpose of each method, the list of input parameters, the output format, description and the types of data used in the output of the methods.

The types of data listed below have been used in the methods:

  • Int32 – integer (32 bits signed) from 2, 147, 483, 648 to 2, 147, 483, 647
  • Int64 – integer (64 bits signed)
  • UInt64 – integer (64 bits unsigned)
  • String - text

Returning the List of Countries

This method returns all destinations of the tour operator.

Format of the query: ?action=GetCountries

Parameters:

  • id – destination country identifier (optional; if specified, only one entry is queried)

The output format:

<getCountriesResult version="1.0">
 <country id="{Int32}" name="{String}" />
 ...
</getCountriesResult>

The root element getCountriesResult contains an arbitrary number of elements country, where each one of them describes destination with attributes: id (destination country identifier) and name (name of the country, Ru/Eng language).

Returning the List of Departure Cities

The method returns all available cities of departure, and also contains data on what tour destinations are available from each city of departure. SletatRu service calls this method periodically in order to update the list of available destinations from each city of departure.

Format of the query: ?action=GetDepartCities

Parameters:

  • id – departure city identifier (optional; if specified, only one entry is queried)

The output format:

<getDepartCitiesResult version="1.0">
 <city id="{Int32}" name="{String}">
 <countryTo id="{Int32}" />
 ...
 </city>...
</getDepartCitiesResult>

The root element getDepartCitiesResult contains an arbitrary number of city elements, where each one of them describes the city of departure with attributes: id (city identifier) и name (name of the city, language Ru/Eng). Each city element also should contain a set of countryTo elements, where each one of them describes available destination from the city of departure; for countryTo element, id attribute (destination country identifier) should be specified.

Returning the List of Resorts

This method returns the list of all available resorts.

Format of the query: ?action=GetResorts

Parameters:

  • id – resort identifier (optional; if specified, only one entry is queried)

The output format:

<getResortsResult version="1.0">
 <resort id="{Int32}" name="{String}" countryId="{Int32}" />
 ...
</getResortsResult>

The root element getResortsResult contains an arbitrary number of resort elements, where each one of them describes the resort with attributes: id (resort identifier), name (name of the resort, language Ru/Eng) and countryId (identifier of the home country of the resort).

Returning the List of Hotel Categories

This method returns the list of hotel categories, e.g. 3*, 4*, Apts, etc.

Format of the query: ?action=GetHotelCategories

Parameters:

  • id – hotel category identifier (optional; if specified, only one entry is queried)

The output format:

<getHotelCategoriesResult version="1.0">
 <hotelCategory id="{Int32}" name="{String}" />
 ...
</getHotelCategoriesResult>

The root element getHotelCategoriesResult contains an arbitrary number of hotelCategory elements, where each one of them describes a hotel category with attributes: id (identifier) and name (name).

Returning the List of Hotels

This method returns the list of all available hotels, preferably only those, which actual prices are available through the tour operator.

Format of the query: ?action=GetHotels

Parameters:

  • id – hotel identifier (optional; if specified, only one entry is queried).

The output format:

<getHotelsResult version="1.0">
 <hotel id="{Int32}" name="{String}" hotelCategoryId="{Int32}" resortId="{Int32}" />
 ...
</getHotelsResult> 

The root element getHotelsResult contains an arbitrary number of hotel elements, where each one of them describes a hotel with attributes: id (identifier), name (name of the hotel), hotelCategoryId (hotel category identifier) and resortId (identifier of the resort in which this hotel is located).

Returning Meal Options

This method returns the list of meal options available, e.g. HB, BB, no meals, etc.

Format of the query: ?action=GetMeals

Parameters:

  • id – identifier of the meal type (optional; if specified, only one entry is queried)

The output format:

<getMealsResult version="1.0">
 <meal id="{Int32}" name="{String}" />
 ...
</getMealsResult>  

The root element getMealsResult contains an arbitrary number of meal elements, where each of them describes a meal option with attributes: id (identifier) and name (name).

Returning the List of Currencies

This method returns the list of used currencies. At the very least it has to contain Russian Rubles, US Dollars and Euros.

Format of the query: ?action=GetCurrencies

Parameters:

  • id – currency identifier (optional; if specified, only one entry is queried)

The output format:

<getCurrenciesResult version="1.0">
 <currency id="{Int32}" name="{String}" />
 ...
</getCurrenciesResult>

The root element getCurrenciesResult contains an arbitrary number of currency elements, where each one of them describes the currency with attributes: id (identifier) and name (name).

Tour Search

The tour search method has multiple parameters of search and tour filtration. The method should return only the cheapest deals, filtered out by a specified parameter. The number of returned tours is regulated by the parameter count.

Format of the query: ?action=GetTours

Parameters:

Parameter; required Type of Data Description
offerId Int64 Unique identifier of the previously found offer. If specified, all other parameters are unnecessary and should be omitted, as well as the method should return only one entry.
count Int32 Maximum number of offers returned by the query.
countryId Int32 Country identifier.
departCityId Int32 Departure city identifier.
dateFrom String First date in the range of departure dates presented in the format dd.MM.yyyy, e.g. 31.12.2015.
dateTo String Last date in the range of departure dates presented in the format dd.MM.yyyy, e.g. 31.12.2015.
adults Int32 Number of adults.
kids Int32 Number of children.
kidsAges String Number of full years of age of each child, transmitted as a string, enumeration separated by comma, e.g. 3, 6. Values 0 or 1 have been used to indicate age of infants.
nightsMin Int32 Minimum number of nights in the tour.
nightsMax Int32 Maximum number of nights in the tour.
resorts String Identifiers of the resorts, enumeration separated by comma.
hotelCategories String Identifiers of hotel categories, enumeration separated by comma.
hotels String Hotel identifiers, enumeration separated by comma.
meals String Identifiers of meal options, enumeration separated by comma.
currencyId Int32 Currency, which also includes prices, as well as currency for input parameters priceMin and priceMax (if specified).
priceMin Int32 Minimum price of the tour.
priceMax Int32 Maximum price of the tour.
hotelIsNotInStop Int32 If input value equals to 1, the results should not contain any hotels with no places available (hotels with the status «on request» are acceptable).
ticketsIncluded Int32 If input value equals to 1, the results should contain only the tours, for which the flight fare is included into the total price (option only hotel is unacceptable).
hasTickets Int32 If input value equals to 1, the results should contain only the tours, for which the tickets are currently available, there should not be flights with no places available or flights with on request status.
excludeUsualTours Int32 If the value is "1", the usual tours (which are not combined, not excursion tours and not shop tours) must be excluded from the result. If the value is "0" or the parameter is missing, those tours must be included into the result.
excludeCombined Int32 If the value is "1", the combined tours (the tourist visits a few resorts during the tour) must be excluded from the result. If the value is "0" or the parameter is missing, those tours must be included into the result.
excludeShopTours Int32 If the value is "1", the shop tours and the tours with the obligations must be excluded from the result. If the value is "0" or the parameter is missing, those tours must be included into the result.
excludeExcursionTours Int32 If the value is "1", the excursion tours must be excluded from the result. If the value is "0" or the parameter is missing, those tours must be included into the result.

The output format:

<getToursResult version="1.0">
 <tour
  offerId="{Int64}"
  tourName="{String}"
  hotelId="{Int32}"
  hotelUrl="{String}"
  resortId="{Int32}"
  hotelCategoryId="{Int32}"
  mealId="{Int32}"
  htPlaceName="{String}"
  roomTypeName="{String}"
  tourDate="{String}"
  nights="{Int32}"
  price="{Int32}"
  hotelIsInStop="{Int32}"
  ticketsIncluded="{Int32}"
  hasEconomTicketsDpt="{Int32}"
  hasEconomTicketsRtn="{Int32}"
  hasBusinessTicketsDpt="{Int32}"
  hasBusinessTicketsRtn="{Int32}"
  tourUrl="{String}"
  spoUrl="{String}"
  fewPlacesInHotel="{Int32}"
  fewTicketsDptY="{Int32}"
  fewTicketsRtnY="{Int32}"
  fewTicketsDptB="{Int32}"
  fewTicketsRtnB="{Int32}"
  flags="{UInt64}"
  description="{String}"
  receivingParty="{String}"
  earlyBookingValidTill="{String}"
  />
 ...
</getToursResult>

The root element getToursResult contains an arbitrary number of tour elements (cannot exceed the number specified in count parameter), where each one of them describes the tour with the following atributes:

Parameter; required Description
offerId Unique identifier of the offer for further tour actualization or booking.
tourName Arbitrary name of the tour.
hotelId Hotel identifier.
hotelUrl Link to the page with the tour description.
resortId Identifier of the resort in which the hotel is located.
hotelCategoryId Hotel category identifier.
mealId Meal option identifier.
htPlaceName Arbitrary name for hotel accommodation preferences, e.g. DBL, TRP, 2 ADL + 1 CH (2-12), 2 ADL + INF). The name should express age of children (if the number of children older than 0 y.o. was specified) or indicate the request for accommodation of an infant (+ INF) respectively.
roomTypeName Name of the room type, e.g. standard, deluxe, family, deluxe super, ocean view.
tourDate Beginning date of the tour in the format dd.MM.yyyy, e.g. 31.12.2015.
tourEndDate Tour end date (arriving date) in format dd.MM.yyyy (for example: 31.12.2015).
nights The number of nights in the tour.
price Price of the tour in currency, specified in the input parameter currencyId.
hotelIsInStop Hotel rooms availability. The following values are acceptable: 0 – rooms available, 1 – rooms unavailable, 2 – on request.
ticketsIncluded Indicator if the ticket prices are included in the tour price. The following values are acceptable: 0 – not included (hotel only tour), 1 – included (package tour).
hasEconomTicketsDpt Availability of economy class tickets to the place of destination. The following values are acceptable: 0 – no tickets available, 1 – tickets available, 2 – on request. If the value of the attribute ticketsIncluded equals to 0, then the value of this parameter will be ignored.
hasEconomTicketsRtn Availability of economy class return tickets. The following values are acceptable: 0 – no tickets available, 1 – tickets available, 2 – on request. If the value of the attribute ticketsIncluded equals to 0, then the value of this parameter will be ignored.
hasBusinessTicketsDpt Availability of business class tickets to the place of destination. The following values are acceptable: 0 – no tickets available, 1 - tickets available, 2 – on request. If the value of the attribute ticketsIncluded equals to 0, then the value of this parameter will be ignored.
hasBusinessTicketsRtn Availability of the business class return tickets. The following parameters are acceptable: 0 – no tickets available, 1 – tickets available, 2 – on request. If the value of the attribute ticketsIncluded equals to 0, then the value of this parameter will be ignored.
tourUrl Link to the booking page (the link can first lead to the page of authorization, and when authorization is complete it should take the customer to the booking page automatically).
spoUrl Link to the tour description and the tour programs (if available).
fewPlacesInHotel The field may be filled if there is an indication that there only few rooms available in the hotel. If the exact number of remaining rooms is not specified, the return value equals to -1, otherwise the value is the exact number of remaining rooms.
fewTicketsDptY The field may be filled if there is an indication that there are only few economy class seats available. If the exact number of remaining seats is not specified, the return value equals to -1, otherwise the value is the exact number of remaining seats.
fewTicketsRtnY The field may be filled if there is an indication that there are only few return flight economy class seats available. If the exact number of remaining return flight seats is not specified, the return value equals to -1, otherwise the value is the exact number of remaining seats.
fewTicketsDptB The field may be filled if there is an indication that there are only few business class seats available. If the exact number of remaining seats is not specified, the return value equals to -1, otherwise the value is the exact number of remaining seats.
fewTicketsRtnB The field may be filled if there is an indication that there are only few return flight business class seats available. If the exact number of remaining return flight seats is not specified, the return value equals to -1, otherwise the value is the exact number of remaining seats.
flags The set of bit flags of the tour. Multiple flags can be attributed to the same tour simultaneously, and the sum of them makes the value of this parameter. Possible flags of the tour:
  • 1 – recommended by the tour operator;
  • 2 – instant confirmation available;
  • 4 – best offer;
  • 8 – early booking available;
  • 16 – late booking available;
  • 32 – discounted tour;
  • 64 – VIP offer;
  • 128 – credit for this tour available;
  • 256 – exclusive offer;
  • 512 – gift offered upon purchase;
  • 1024 – combined tour;
  • 2048 – tour with obligation (shopping tour);
  • 4096 – reserved for system use;
  • 8192 – excursion tour;
description Additional information on the tour, e.g. hotel accommodation info for combined tours.
receivingParty Receiving party.
earlyBookingValidTill If the tour is available for early booking and the last date of early booking is known, then the field should contain this date.

Tour Actualization

This method gets the tour final price (including all mandatory surcharges and fees), list of included services, flight options, additional services and surcharges. The method should return the price of the least expensive configuration of the offer queried. For correct functioning of this method it is necessary that offerId be unique for the offers with various composition of the tourist group even if all the other parameters of the offers have the same values.

The format of the query: ?action=ActualizeTour

Parameters:

Parameter; required Type of Data Description
offerId Int64 Unique identifier of the previously found offer.
currencyId Int32 Currency to calculate the price and surcharges in.

The output format:

<actualizeTourResult version="1.0">
 <actualizedTour
  price="{Int32}"
  ticketsIsIncluded="{Int32}"
  hotelIsInStop="{Int32}"
  hasEconomTicketsDpt="{Int32}"
  hasEconomTicketsRtn="{Int32}"
  hasBusinessTicketsDpt="{Int32}"
  hasBusinessTicketsRtn="{Int32}"
  fewPlacesInHotel="{Int32}"
  fewEconomTicketsDpt="{Int32}"
  fewEconomTicketsRtn="{Int32}"
  fewBusinessTicketsDpt="{Int32}"
  fewBusinessTicketsRtn="{Int32}"
  tourUrl="{String}"
 >
  <services>
   <service
    id="{Int32}"
    type="{String}"
    name="{String}"
    isIncluded="{Int32}"
    description="{String}"
    surcharge="{Int32}"
    flightCompatibleIds="{String}"
    flightClass="{String}"
    flightAvailability="{Int32}"
    flightPlacesCount="{Int32}"
    flightAirportFrom="{String}"
    flightAirportTo="{String}"
    flightNum="{String}"
    flightAirline="{String}"
    flightStartDateTime="{String}"
    flightEndDateTime="{String}"
    flightAircraft="{String}"
   />
   ...
  </services>
 </actualizedTour>
</actualizeTourResult>

The root element actualizeTourResult should only contain a single actualizedTour element, described with the following attributes:

Parameter; required Description
price Actualized price of the tour in currency, specified in the currencyId input parameter.
ticketsIsIncluded Indicator if the tickets price is included in the tour price. The following values are acceptable: 0 – not included (hotel tour only), 1 – included (package tour).
hasEconomTicketsDpt Availability of economy class tickets to the place of destination. The following values are acceptable: 0 – no tickets available, 1 – tickets available, 2 – on request. If the value of the attribute ticketsIncluded equals to 0, then the value of this parameter will be ignored.
hasEconomTicketsRtn Availability of return tickets of economy class. The following values are acceptable: 0 – no tickets available, 1 – tickets available, 2 – on request. If the value of the attribute ticketsIncluded equals to 0, then the value of this parameter will be ignored.
hasBusinessTicketsDpt Availability of business class tickets to the place of destination. The following values are acceptable: 0 – no tickets available, 1 – tickets available, 2 – on request. If the value of the attribute ticketsIncluded equals to 0, then the value of this parameter will be ignored.
hasBusinessTicketsRtn Availability of return tickets of the business class. The following values are acceptable: 0 – no tickets available, 1 – tickets available, 2 – on request. If the value of the attribute ticketsIncluded equals to 0, then the value of this parameter will be ignored.
fewPlacesInHotel The field is may be filled if there is an indication that there only few rooms available in the hotel. If the exact number of remaining rooms is not specified, the return value equals to -1, otherwise the value is the exact number of remaining rooms.
fewEconomTicketsDpt The field may be filled if there is an indication that there are only few economy class seats available. If the exact number of remaining seats is not specified, the return value equals to -1, otherwise the value is the exact number of remaining seats.
fewEconomTicketsRtn The field may be filled if there is an indication that there are only few return flight economy class seats available. If the exact number of remaining return flight seats is not specified, the return value equals to -1, otherwise the value is the exact number of remaining seats.
fewBusinessTicketsDpt The field may be filled if there is an indication that there are only few business class seats available. If the exact number of remaining seats is not specified, the return value equals to -1, otherwise the value is the exact number of remaining seats.
fewBusinessTicketsRtn The field may be filled if there is an indication that there are only few return flight business class seats available. If the exact number of remaining return flight seats is not specified, the return value equals to -1, otherwise the value is the exact number of remaining seats.
tourUrl Link to the booking page (the link can first lead to the page of authorization, and when authorization is complete it should take the customer to the booking page automatically).

The element actualizedTour can contain services section, which in turn contains an arbitrary number of service elements. Each service element describes the service either included into the price of the tour or the service which can be added to the current configuration of the tour. Attributes of service element are as following:

Parameter; required Description
id Service identifier, unique for this offer.
type Service type. Accepts one of the following values:
  • “Insurance” – insurance;
  • “DptTransport” – destination flight;
  • “RtnTransport” – return flight;
  • “AdditionalService ” – additional service;
  • “AdditionalMeal” – extra meals;
  • “Transfer” – transfer;
  • “Excursion” – excursion;
  • “Charge” – surcharges;
  • “Visa” – visa;
  • “NoGoGuarantee” – insurance for the case of tour cancellation;
name Service name.
isIncluded Indicator if the current service is included into the price of the current configuration of the tour. The following values are acceptable: 0 – not included, 1 – included.
description Description of the service in a free form.
surcharge Surcharges for inclusion of the service into the tour price. Applies only to the services, not included in the current configuration of the tour.
flightCompatibleIds Compatible flights. Identifiers of flight services from the services section, which can be applied together with the current flight service. For the destination flight, id of return flights is filled out and vice versa. This parameter applies and is required only for the services of DptTransport and RtnTransport types.
flightClass Flight class. Can accept one of the following values:
  • “ECONOM” – economy;
  • “BUSINESS” – business;

This parameter applies and is required only for the services of DptTransport and RtnTransport types.

flightAvailability Tickets availability with the following acceptable values: 0 – no tickets available, 1 – tickets available, 2 – on request. This parameter applies and is required only for the services of DptTransport and RtnTransport types.
flightPlacesCount Number of available tickets. The field is completed only if there are few tickets available. If the number of available tickets is known, the value is this number. Otherwise, the value equals to -1. The may be filled only for the services of DptTransport and RtnTransport types.
flightAirportFrom Departure airport. The value should begin with IATA code, followed by additional information, e.g. the terminal (example: SVO C). This parameter applies and is required only for the services of DptTransport and RtnTransport types.
flightAirportTo Arrival airport. The value should begin with IATA code, followed by additional information, e.g. the terminal (example: AYT 1). This parameter applies and is required only for the services of DptTransport and RtnTransport types.
flightNum Flight, e.g. UN 7422. The field may be filled only for the services of DptTransport and RtnTransport types.
flightAirline Airline. The field may be filled only for the services of DptTransport and RtnTransport types.
flightStartDateTime Departure date and time in the format dd.MM.yyyy HH:mm (e.g.: 31.12.2015 14:30). The field may be filled only for the services of DptTransport and RtnTransport types.
flightEndDateTime Arrival date and time in the format dd.MM.yyyy HH:mm (e.g.: 31.12.2015 14:30). The field may be filled only for the services of DptTransport and RtnTransport types.
flightAircraft Information about the aircraft. The field may be filled only for the services of DptTransport and RtnTransport types.