Masterdata

Summary

The masterdata component consists of the following two endpoints:

  • Search is for general usage; this will search through all location data and find appropriate entries for a given keyword, intended mostly to be used for autocompleting the location field for users.
  • Retrieval is the call used to retrieve all data of a certain type. This should not be used very often—data is cached for 24 hours, but downloading these once or twice a month should be sufficient.

Retrieval

Request

GET /masterdata/:category

category is the data repo you’d like to retrieve. It can be one of the following:

  • airlines
  • airplanes
  • airports
  • categories
  • cities
  • localised_cities
  • countries
  • states
  • hotel_chains
  • hotels
  • rule_links
  • eticket_rules

Response Body

The response will have a root container that is unique to the requested data repo. This is an array, containing objects that are, again, unique.

Note

A small cosmetic deficiency in the XML output is that the tags of the child elements are generated from the root tag, by a not-so-intelligent block of word singularizing code. This can lead to things such as a <Cities> root containing <Citie> elements. When the root doesn’t end with the letter S, the XML generator just defaults to calling the children <item>s.

Examples

Response

JSON:

{
  "Airlines": [
    {
      "Active": "true",
      "AirLineCode": "01",
      "AirLineName": "RailEasy",
      "ProviderType": "TravelFusion2Provider"
    },
    {
      "Active": "true",
      "AirLineCode": "08",
      "AirLineName": "Air Southwest",
      "CountryCode": "GB",
      "ProviderType": "ERetailWebFareProvider"
    }
  ]
}

XML:

<Airlines>
  <Airline>
    <Active>true</Active>
    <AirLineCode>ZY</AirLineCode>
    <ProviderType>AmadeusProvider;SkyProvider</ProviderType>
    <AirLineName>Sky Airlines</AirLineName>
  </Airline>
  <Airline>
    <Active>false</Active>
    <AirLineCode>ZZ</AirLineCode>
    <ProviderType>AmadeusProvider</ProviderType>
    <AirLineName>Airline Service</AirLineName>
  </Airline>
</Airlines>