Show last authors
1 = SIRI VehicleMonitoring Call =
2
3 The SIRI VehicleMonitoring ("SIRI VM") call allows the developer to request information about one, some, or all vehicles monitored by the MTA Bus Time system. As much as possible, the values used both in the VM request and the VM response correspond to the values in the GTFS data.
4
5 == SIRI VehicleMonitoring Requests ==
6
7 It is accessible at the following URLs:
8
9 https://bustime.mta.info/api/siri/vehicle-monitoring.json
10
11 Please note that the calls made without either a VehicleRef or LineRef produces quite a load on the system, so use them sparingly. Any developers found to be making repeated calls (e.g. at less than 30 second intervals) for all vehicles in the system may find their key revoked.
12
13 with the following GET parameters:
14
15 * **key** - your MTA Bus Time developer API key (required). Go {{html}}<a href="https://spreadsheets.google.com/viewform?hl=en&formkey=dG9kcGIxRFpSS0NhQWM4UjA0V0VkNGc6MQ#gid=0">here</a>{{/html}} to get one.
16
17 * **version** - which version of the SIRI API to use (1 or 2). Defaults to 1, but 2 is preferrable.
18
19 * **OperatorRef** - the GTFS agency ID to be monitored (optional). Currently ##MTA##.
20
21 * **VehicleRef** - the ID of the vehicle to be monitored (optional). This is the 4-digit number painted on the side of the bus, for example ##7560##. Response will include all buses if not included.
22
23 * **LineRef** - a filter by 'fully qualified' route name, GTFS agency ID + route ID (optional).
24
25 * **DirectionRef** - a filter by GTFS direction ID (optional). Either ##0## or ##1##.
26
27 * **VehicleMonitoringDetailLevel** - Level of detail present in response. In order of verbosity:
28 ##minimum## - only available in version 2. Designed for front-end use.
29 ##basic## - only available in version 2. Designed for system-to-system interchange when GTFS is loaded.
30 ##normal## - default.
31 ##calls## Determines whether or not the response will include the stops ("calls" in SIRI-speak) each vehicle is going to make **after** it serves the selected stop.
32
33 * **MaximumNumberOfCallsOnwards** Limit on the number of ##OnwardCall## elements for each vehicle when ##VehicleMonitoringDetailLevel=calls##
34
35 * **MaximumStopVisits** - an upper bound on the number of buses to return in the results.
36
37 * **MinimumStopVisitsPerLine** - a lower bound on the number of buses to return in the results per line/route (assuming that many are available)
38
39 == SIRI VehicleMonitoring Responses ==
40
41 The XML below illustrates the SIRI VehicleMonitoring response. The comments in the XML below document the meaning of each of the XML elements that are unique to the SIRI VehicleMonitoring call. Much of the interesting data is contained inside the ##MonitoredVehicleJourney## element, which has [[its own documentation>>Developers.SIRIMonitoredVehicleJourney]].
42
43
44 ##
45 <!~-~- SIRI container elements ~-~->
46 <Siri version="1.3" xmlns="http://www.siri.org.uk/siri">
47 <ServiceDelivery>
48 \\\\ <!~-~- The timestamp on the MTA Bus Time server at the time the request was fulfilled ~-~->
49 <ResponseTimestamp>2011-01-28T14:22:48-05:00</ResponseTimestamp>
50 \\\\ <!~-~- SIRI container for VehicleMonitoring response data ~-~->
51 <VehicleMonitoringDelivery version="1.3">
52 \\\\ <!~-~- Same as above. Required by the SIRI spec. ~-~->
53 <ResponseTimestamp>2011-01-28T14:22:48-05:00</ResponseTimestamp>
54 <!~-~- The time until which the response data is valid until. ~-~->
55 <ValidUntil>2011-01-28T14:23:48-05:00</ValidUntil>
56 \\\\ <!~-~- SIRI container for data about a particular vehicle ~-~->
57 <VehicleActivity>
58 \\\\ <!~-~- The timestamp of the last real-time update from the particular vehicle ~-~->
59 <RecordedAtTime>2011-01-28T14:22:30-05:00</RecordedAtTime>
60 \\\\ <!~-~- A [[MonitoredVehicleJourney>>Developers.SIRIMonitoredVehicleJourney]] element for a vehicle in revenue service. Please See the MonitoredVehicleJourney page for a thorough discription ~-~->
61 <MonitoredVehicleJourney>
62 ...
63 </MonitoredVehicleJourney>
64 </VehicleActivity>
65 \\\\ <!~-~- The next vehicle. ~-~->
66 <VehicleActivity>
67 <RecordedAtTime>2011-01-28T14:22:43-05:00</RecordedAtTime>
68 \\\\ <!~-~- A complete [[MonitoredVehicleJourney>>Developers.SIRIMonitoredVehicleJourney]] element. See the MonitoredVehicleJourney page for more information~-~->
69 <MonitoredVehicleJourney>...</MonitoredVehicleJourney>
70 </VehicleActivity>
71 \\\\ ... More VehicleActivity elements
72 \\\\ </VehicleMonitoringDelivery>
73 </ServiceDelivery>
74 </Siri>
75 ##