#AutoTranslate
Brief Description
Further details about a trip can be requested with TripInfoRequest.
Technical Description
API Explorer
You can try out your own requests – direct link to API Explorer.
Request
The main information for a TripInfoRequest is a ojp:JourneyRef with ojp:OperatingDayRef – i.e. a reference to a very specific journey on a calendar day. The JourneyRef must be read from the response to another request (e.g. TripRequest or StopEventRequest).
<?xml version="1.0" encoding="UTF-8"?>
<OJP xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.siri.org.uk/siri" version="1.0" xmlns:ojp="http://www.vdv.de/ojp" xsi:schemaLocation="http://www.siri.org.uk/siri ../ojp-xsd-v1.0/OJP.xsd">
<OJPRequest>
<ServiceRequest>
<RequestTimestamp>2020-01-20T12:00:00Z</RequestTimestamp>
<RequestorRef>IRMA</RequestorRef>
<ojp:OJPTripInfoRequest>
<RequestTimestamp>2020-01-20T12:00:00Z</RequestTimestamp>
<MessageIdentifier>756</MessageIdentifier>
<ojp:JourneyRef>ch:1:sjyid:100001:612-002</ojp:JourneyRef>
<ojp:OperatingDayRef>2020-01-20</ojp:OperatingDayRef>
<ojp:Params>
<ojp:IncludeCalls>true</ojp:IncludeCalls>
<ojp:IncludePosition>false</ojp:IncludePosition>
<ojp:IncludeService>true</ojp:IncludeService>
<ojp:IncludeTrackSections>true</ojp:IncludeTrackSections>
<ojp:IncludeTrackProjection>true</ojp:IncludeTrackProjection>
</ojp:Params>
</ojp:OJPTripInfoRequest>
</ServiceRequest>
</OJPRequest>
</OJP>
| Item | Cardinality | Description | Example |
|---|---|---|---|
RequestTimestamp |
1:1 | The timestamp of the request. Preferably in UTC time. |
<RequestTimestamp>2020-01-20T12:00:00Z</RequestTimestamp> |
MessageIdentifier |
0:1 | The identifier of the message. Increasingly increasing number preferred. |
<MessageIdentifier>756</MessageIdentifier> |
JourneyRef |
0:1 | Reference to the journey.
TripRequest or StopEventRequest to obtain the reference. |
<ojp:JourneyRef>ch:1:sjyid:100001:612-002</ojp:JourneyRef>
|
OperatingDayRef |
0:1 | In the format YYYY-MM-DD |
<ojp:OperatingDayRef>2026-06-23</ojp:OperatingDayRef>
|
siri:VehicleRef |
0:1 | n/a
This feature is not available. |
n/a |
TimeOfOperation |
0:1 | n/a
This feature is not available. |
n/a |
Params |
0:1 | Additional parameters for the request | |
Params/UseTimetableDataOnly |
0:1 | Omit real-time data? Default is false. | |
Params/IncludeCalls |
0:1 | Include calls (intermediate stops)? Default is true. | |
Params/IncludePosition |
0:1 | Include the current position of the train?
This feature is not available. |
n/a |
Params/IncludeService |
0:1 | Include the service details (LineRef, Mode, OperatorRef, etc.)? The default is true. | |
Params/IncludeTrackSections |
0:1 | Include geographic information of the route? Default is false. | |
Params/IncludeTrackProjection |
0:1 | Should coordinate projections also be transmitted?
This feature is under consideration. |
Response
At the top (from the actual content) is TripInfoResponseContext above all information on the ‘places’ used – see more detailed description in OJPTripRequest
<ojp:TripInfoResponseContext>
<ojp:Places>
<ojp:Location>
<ojp:StopPlace>
<ojp:StopPlaceRef>ch:1:sloid:3000</ojp:StopPlaceRef>
<ojp:StopPlaceName>
<ojp:Text>Zürich HB</ojp:Text>
</ojp:StopPlaceName>
<ojp:PrivateCode>
<ojp:System>EFA</ojp:System>
<ojp:Value>104014:0:8</ojp:Value>
</ojp:PrivateCode>
<ojp:TopographicPlaceRef>23026261:27</ojp:TopographicPlaceRef>
</ojp:StopPlace>
<ojp:LocationName>
<ojp:Text xml:lang="de">Zürich HB</ojp:Text>
</ojp:LocationName>
<ojp:GeoPosition>
<siri:Longitude>8.54021</siri:Longitude>
<siri:Latitude>47.37818</siri:Latitude>
</ojp:GeoPosition>
</ojp:Location>
<!-- ... -->
</ojp:Places>
</ojp:TripInfoResponseContext>
TripInfoResult
Please note: Depending on the parameters that are set, the elements listed below may or may not be included in the response. You may therefore need to check the parameters in the request to include or exclude certain elements.
Example of a complete answer: TripInfoRequest_example_response
The context is followed by the journey itself; starting with all stops Previous call (previous stops) and Onward calls (stops below). This may contain more stops than the TripRequest that was used to determine the JourneyRef because the TripInfoRequest returns the entire journey.
If real-time was not excluded with UseTimetableDataOnly=true in the request, real-time data (if available) is included (EstimatedTime, EstimatedQuay) in addition to the scheduled departure/arrival times and platforms (TimetabledTime, Planned Quay).
Example: In a TripRequest from Bern to Zurich, the TripInfoRequest could return a trip from Geneva to St. Gallen of which the Bern-Zurich section is a subset.
<ojp:TripInfoResult>
<ojp:PreviousCall>
<siri:StopPointRef>ch:1:sloid:3000</siri:StopPointRef>
<ojp:StopPointName>
<ojp:Text>Zürich HB</ojp:Text>
</ojp:StopPointName>
<ojp:PlannedQuay>
<ojp:Text xml:lang="de">8</ojp:Text>
</ojp:PlannedQuay>
<ojp:EstimatedQuay>
<ojp:Text xml:lang="de">9</ojp:Text>
</ojp:EstimatedQuay>
<ojp:ServiceDeparture>
<ojp:TimetabledTime>2020-07-13T13:32:00Z</ojp:TimetabledTime>
<ojp:EstimatedTime>2020-07-13T13:32:00Z</ojp:EstimatedTime>
</ojp:ServiceDeparture>
<ojp:Order>1</ojp:Order>
</ojp:PreviousCall>
<ojp:PreviousCall>
<siri:StopPointRef>ch:1:sloid:2204</siri:StopPointRef>
<ojp:StopPointName>
<ojp:Text>Zug</ojp:Text>
</ojp:StopPointName>
<ojp:PlannedQuay>
<ojp:Text xml:lang="de">4</ojp:Text>
</ojp:PlannedQuay>
<ojp:ServiceArrival>
<ojp:TimetabledTime>2020-07-13T13:56:00Z</ojp:TimetabledTime>
<ojp:EstimatedTime>2020-07-13T13:57:00Z</ojp:EstimatedTime>
</ojp:ServiceArrival>
<ojp:ServiceDeparture>
<ojp:TimetabledTime>2020-07-13T13:58:00Z</ojp:TimetabledTime>
<ojp:EstimatedTime>2020-07-13T13:59:00Z</ojp:EstimatedTime>
</ojp:ServiceDeparture>
<ojp:Order>2</ojp:Order>
</ojp:PreviousCall>
<!-- ... -->
<ojp:OnwardCall>
<siri:StopPointRef>ch:1:sloid:5300</siri:StopPointRef>
<ojp:StopPointName>
<ojp:Text>Lugano</ojp:Text>
</ojp:StopPointName>
<ojp:PlannedQuay>
<ojp:Text xml:lang="de">3</ojp:Text>
</ojp:PlannedQuay>
<ojp:ServiceArrival>
<ojp:TimetabledTime>2020-07-13T15:56:00Z</ojp:TimetabledTime>
<ojp:EstimatedTime>2020-07-13T15:52:00Z</ojp:EstimatedTime>
</ojp:ServiceArrival>
<ojp:Order>8</ojp:Order>
</ojp:OnwardCall>
<!-- ... -->
</ojp:TripInfoResult>
Then the information on Service: LineRef, Mode (transport type), OperatorRef, etc.
<ojp:TripInfoResult>
<!-- ... -->
<ojp:Service>
<ojp:OperatingDayRef>2020-07-13</ojp:OperatingDayRef>
<ojp:JourneyRef>ojp:91002:F:R:j20:205</ojp:JourneyRef>
<siri:LineRef>ojp:91002:F</siri:LineRef>
<siri:DirectionRef>R</siri:DirectionRef>
<ojp:Mode>
<ojp:PtMode>rail</ojp:PtMode>
<siri:RailSubmode>local</siri:RailSubmode>
<ojp:Name>
<ojp:Text xml:lang="de">Zug</ojp:Text>
</ojp:Name>
<ojp:ShortName>
<ojp:Text xml:lang="de">IC</ojp:Text>
</ojp:ShortName>
</ojp:Mode>
<ojp:PublishedLineName>
<ojp:Text>2</ojp:Text>
</ojp:PublishedLineName>
<ojp:OperatorRef>ojp:11</ojp:OperatorRef>
<ojp:OriginStopPointRef>ch:1:sloid:3000</ojp:OriginStopPointRef>
<ojp:OriginText>
<ojp:Text xml:lang="de">Zürich HB</ojp:Text>
</ojp:OriginText>
<ojp:DestinationStopPointRef>8505300</ojp:DestinationStopPointRef>
<ojp:DestinationText>
<ojp:Text xml:lang="de">Lugano</ojp:Text>
</ojp:DestinationText>
</ojp:Service>
<!-- ... -->
</ojp:TripInfoResult>
Subsequently, JourneyTrack (request parameter: IncludeTrackSections) geographical information about the journey.
<ojp:TripInfoResult>
<!-- ... -->
<ojp:JourneyTrack>
<ojp:TrackSection>
<ojp:TrackStart>
<siri:StopPointRef>ch:1:sloid:3000</siri:StopPointRef>
<ojp:LocationName>
<ojp:Text xml:lang="de">Zürich HB</ojp:Text>
</ojp:LocationName>
</ojp:TrackStart>
<ojp:TrackEnd>
<siri:StopPointRef>8505307</siri:StopPointRef>
<ojp:LocationName>
<ojp:Text xml:lang="de">Chiasso</ojp:Text>
</ojp:LocationName>
</ojp:TrackEnd>
<ojp:Length>220041</ojp:Length>
</ojp:TrackSection>
</ojp:JourneyTrack>
</ojp:TripInfoResult>
Lastly, the extension currently only contains the published number (in the example below ‘319’ because it is the EC 319)
<ojp:TripInfoResult>
<!-- ... -->
<ojp:Extension>
<ojp:TransportTypeName>
<ojp:Text xml:lang="de"></ojp:Text>
</ojp:TransportTypeName>
<ojp:PublishedJourneyNumber>
<ojp:Text xml:lang="de">319</ojp:Text>
</ojp:PublishedJourneyNumber>
</ojp:Extension>
</ojp:TripInfoResult>
