#AutoTranslate
Brief Description
Further details about a journey can be requested with TripInfoRequest.
Technical Description
API Explorer
You can try out your own requests – direct link to API Explorer.
Request
The key information for TripInfoRequest is an ojp:JourneyRef with ojp:OperatingDayRef – i.e. a reference to a very specific journey on a calendar day. The JourneyRef must be found in 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>qv1:91011::H:j20:500</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>
| Element | Cardinality | Description | Example |
|---|---|---|---|
RequestTimestamp |
1:1 | Timestamp of the request. Preferably in UTC. |
<RequestTimestamp>2020-01-20T12:00:00Z</RequestTimestamp> |
MessageIdentifier |
0:1 | The identifier of the incident. Increasingly preferred. |
<MessageIdentifier>756</MessageIdentifier> |
JourneyRef |
0:1 | Reference to the journey.
The reference can be obtained using TripRequest or StopEventRequest. |
<ojp:JourneyRef>qv1:91011::H:j20:500</ojp:JourneyRef>
|
OperatingDayRef |
0:1 | Format YYYY-MM-DD |
<ojp:OperatingDayRef>2020-01-20</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 | Should real time be avoided? Default is false. | |
Params/IncludeCalls |
0:1 | Include the ‘calls’ (intermediate stops)? Default is true. | |
Params/IncludePosition |
0:1 | Insert the current position of the train?
This feature is not available. |
n/a |
Params/IncludeService |
0:1 | Include the service information (LineRef, Mode, OperatorRef, ..)? Default is true. | |
Params/IncludeTrackSections |
0:1 | Include geographical details of the route? The default is false. | |
Params/IncludeTrackProjection |
0:1 | Should coordinate projections also be transmitted?
This feature is under consideration. |
Response
At the top (of the actual content) is TripInfoResponseContext in particular information on the ‘places’ used – see more detailed description in OJPTripRequest
<ojp:TripInfoResponseContext>
<ojp:Places>
<ojp:Location>
<ojp:StopPlace>
<ojp:StopPlaceRef>8503000</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 parts listed below may or may not be included in the response. Therefore, if necessary, check the parameters in the request to (not) receive certain parts.
Example of a complete answer: TripInfoRequest_example_response
Depending on the context, the journey itself comes; first all the stops with PreviousCalls (previous stops) and OnwardCalls (following stops). This may contain more stops than the TripRequest used to determine the JourneyRef because the TripInfoRequest returns the entire trip.
If real-time was not excluded in the request with UseTimetableDataOnly=true, real-time data (if available) is also provided (EstimatedTime, EstimatedQuay) in addition to the scheduled departure/arrival time and platform (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>8503000</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>8502204</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>8505300</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>8503000</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, in JourneyTrack (Parameter in the request: IncludeTrackSections) geographical information about the journey provided.
<ojp:TripInfoResult>
<!-- ... -->
<ojp:JourneyTrack>
<ojp:TrackSection>
<ojp:TrackStart>
<siri:StopPointRef>8503000</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 only information in the extension is currently 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>
