Skip to content

OJPTripInfoRequest

OJPTripInfoRequest

Further details about a trip can be requested with TripInfoRequest.

API Explorer

You can try your own requests – direct link to the 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 out of 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 message. Incrementally increasing numbers preferred.
<MessageIdentifier>756</MessageIdentifier>
JourneyRef 0:1 Reference to the journey.

Use TripRequest or StopEventRequest to obtain the reference.

<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 Further request parameters
Params/UseTimetableDataOnly 0:1 Ignore 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.)? Default is true.
Params/IncludeTrackSections 0:1 Include geographical details of the route? The default value is false.
Params/IncludeTrackProjection 0:1 Send coordinate projections too?

This feature is under consideration.

Response

TripInfoResponseContext is supplied at the top (before the actual content), and contains mainly information on the “places” specified – 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 elements listed below will be included or excluded from the response. It may therefore be useful to check the parameters in the request to include/exclude specific elements.

Example of a complete response: TripInfoRequest_example_response

The context is followed by information about the journey itself; starting with all the stops in PreviousCalls (previous stops) and OnwardCalls (stops after the destination). It may contain more stops than the TripRequest that was used to establish 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 and 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>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>

Next are the details of the 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>

This is followed by JourneyTrack (request parameter: IncludeTrackSections) with geographical details of the journey.

<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 extension currently only shows one item of information, the published number. In the example below it is “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>