Rail suppliers are supported within the flights API, with a few minor differences. To illustrate these differences, some example XML is given below for a search from London to Birmingham: Request<CommandList>
<StartRouting> <XmlLoginId>HJHH3K9HTYHJ45T0</XmlLoginId> <LoginId>HJHH3K9HTYHJ45T0</LoginId> <Mode>Plane</Mode> <Origin> <Descriptor>LON</Descriptor> <Type>airportgroup</Type> </Origin> <Destination> <Descriptor>BHX</Descriptor> <Type>airportgroup</Type> </Destination> <OutwardDates> <DateOfSearch>20/06/2011-16:56</DateOfSearch> </OutwardDates> <MaxChanges>100</MaxChanges> <MaxHops>100</MaxHops> <SupplierList> <Supplier>raileasy</Supplier> </SupplierList> <Timeout>300</Timeout> <TravellerList> <Traveller> <Age>30</Age> </Traveller> </TravellerList> </StartRouting> </CommandList>
Various types of location can be specified in the request:
airportcode
| A small radius should be specified (around 5000m) and stations within this distance from the airport specified will then be searched. | | citycode | The radius will be ignored and the main stations for the specified city will be searched | | airportgroup | The main stations for the specified city will be searched | | trainstationcode | This can be used to specify individual stations. If you wish to do this, please contact Travelfusion for more information. A radius of 1m is recommended to ensure no other stations are searched |
The results will be very similar to normal flight results, but the partial response sample below illustrates the main differences between flight and train results:
<CommandList> <CheckRouting millis="4"> ...... <RouterList> <Router> ......... <RequestedLocations> <Origin> <Type>city</Type> <Code>LON</Code> </Origin> ......... </RequestedLocations> <GroupList> <Group> <OutwardList> <Outward> ......... <SegmentList> <Segment> <Origin> <Type>trainstation</Type> <Code>EUS</Code> <SupplierDisplayName>London Euston, Gtlon</SupplierDisplayName> </Origin> ...................... </Segment> </SegmentList> </Outward> </OutwardList> </Group> </GroupList> </Router> </RouterList> <Summary> <Origin> ........... <StationList> <Station> <Name>London Euston, Gtlon</Name> <Code>EUS</Code> <City> <Name>London</Name> <Code>LON</Code> </City> </Station> </StationList> </Origin> .............. </Summary> </CheckRouting> </CommandList>
Summary of differences: - In the RequestedLocations, the location type may be trainstation. This is in cases where a specific station is requested from the supplier, because a specific station is requested from Travelfusion or the supplier does not support a city-based searching and so individual stations must be requested. In these cases, the Descriptor will be the Travelfusion station code
- In the Segment, the Origin (and Destination) will normally have type trainstation. The code will be the Travelfusion station code.
- In the Summary, there is a new element 'StationList'. This lists the relevant stations, with their related cities and the Travelfusion code and name for the station.
|