CancelledTripAPIFeatures

Version 2.1 by admin admin on 2024/07/23 04:52

SIRI API

API paths

There are two available versions of the SIRI api and each of those is available with or without cancelled trip information. This table shows the API path to reach the four possible combinations:

 Without Cancelled Trip Information With Cancelled Trip Information
 SIRI v1  /api/siri/stop-monitoring.xml /api/2/siri/stop-monitoring.xml 
 SIRI v2  /api/siri/stop-monitoring.xml?version=2 /api/2/siri/stop-monitoring.xml?version=2

As before, the version of SIRI is specified with a query parameter "version" and the possible values are '1' or '2'.

If cancelled trip information is not desired, you can continue to use the same path as before.

To include cancelled trip information add a '2' path parameter between /api/ and /siri/

Stop-monitoring output

If the stop being queried has no cancelled trips, there is no change to the output.

If there are relevant cancelled trips for the stop, they will appear as a MonitoredStopVisit.

It's important to note that previously, scheduled trips without corresponding real-time data would simply not appear. But if a scheduled trip missing real time data is also marked as cancelled, it will appear in the output.

Cancelled trips which are relevant to the stop being monitored will appear as a MonitoredStopVisit.

For SIRI V1, if a trip is cancelled then MonitoredStopVisit>MonitoredVehicleJourney>MonitoredCall will have two properties, ArrivalStatus and DepartureStatus, both of which will show cancelled:

<MonitoredVehicleJourney>

    <MonitoredStopVisit>

        <MonitoredCall>

            <ArrivalStatus>cancelled</ArrivalStatus>

            <DepartureStatus>cancelled</DepartureStatus>

        </MonitoredCall>

    </MonitoredStopVisit>

</MonitoredVehicleJourney>

For SIRI V2 if a trip is cancelled then its MonitoredStopVisit>MonitoredVehicleJourney will have one property, VehicleStatus, which will show cancelled:

<MonitoredStopVisit>

    <MonitoredVehicleJourney>

        <VehicleStatus>cancelled</VehicleStatus>

    </MonitoredVehicleJourney>

<MonitoredStopVisit>

GTFS-RT

Trip Update Support

The GTFS-RT component has been extended to support Trip Updates of the type ScheduleRelationship.CANCELLED:

 entity {
  id: "GH_A2-Weekday-SDon-056200_BX39_754"
  trip_update {
    trip {
      trip_id: "GH_A2-Weekday-SDon-056200_BX39_754"
      start_date: "20220310"
      schedule_relationship: CANCELED
      route_id: "BX39"
      direction_id: 0
    }
    timestamp: 1646921884575
  }
}

The GTFS-RT trip updates feed remains at the same location, no change is necessary to consume the new data. https://gtfsrt.prod.obanyc.com/tripUpdates

Alert Support

The GTFS-RT component now includes a consequence effect to allow CAPI alerts to be readily differentiated from Mercury alerts.  The consequence are of the type REDUCED_SERVICE as shown below:

 entity {
  id: "MTA NYCT_GH_A2-Weekday-SDon-063200_BX39_765"
  alert {
    informed_entity {
      agency_id: "MTA NYCT"
      trip {
        route_id: "BX39"
        direction_id: 0
      }
    }
    informed_entity {
      agency_id: "MTA NYCT"
      trip {
        route_id: "BX39"
        direction_id: 1
      }
    }
    effect: REDUCED_SERVICE
    description_text {
      translation {
        text: "The 10:32am BX39 to SOUNDVIEW AV/CORNELL AV is canceled"
        language: "EN"
      }
    }
  }
}

The GTFS-RT alerts feed remains at the same location, no change is necessary to consume the new data. https://gtfsrt.prod.obanyc.com/alerts