Beta: Block Status v2 web service
Base HTTP URL: http://developer.trimet.org/ws/v2/blockStatus
Base HTTPS URL: https://developer.trimet.org/ws/v2/blockStatus
Service returns the status of currently operating blocks (units of work assigned to a vehicle).
Request parameters:
Name | Value | Description |
---|---|---|
appID | string (required) | Your appID received during registration. |
blockID | blockId to retrieve the status of (optional) | Block to retrieve status for. |
blockIDs | comma delimited list of blockIDs to retrieve the status of(optional) | Blocks to retrieve status for. |
json | boolean value "true" (default) or "false" | If true results will be in json format. If false results will be returned in xml format.t. |
showRoutes | boolean value "true" (default) or "false" | If true route elements will be included in the resultSet. These are the same as is provided in the routeConfig service, and the same parameters are accepted, except for routeIds. Note that some routes will not be present such as dead head routes such as those that are out of service heading to or from a garage or rail yard. |
showStops | boolean value "true" (default) or "false" | If true location elements will be included in the resultSet. |
Response fields:
Note: all times values are in Unix time format, milliseconds since epoch.
Name | Description |
---|---|
resultSet | Root element of all results |
resultSet[@queryTime] | Time the result was generated. |
errorMessage | This element will occur if there was an error processing your request and contains a description of the problem. |
blockStatus | Element containing the status of requested blocks. |
blockStatus[@blockID] | Integer ID of the block number. |
blockStatus[@currentTripID] | Optional field containing the trip ID the block is currently on. If no vehicle position if available or the block is not currently serving a trip this field will be omitted. |
blockStatus[@lat] | Optional field containing the latitude of the vehicle at the time the position was reported. If no vehicle position if available this field will be omitted. |
blockStatus[@lng] | Optional field containing the longitude of the vehicle at the time the position was reported. If no vehicle position if available this field will be omitted. |
blockStatus[@bearing] | Optional field containing the bearing of the vehicle if available. 0 is north, 180 is south. If no vehicle position if available this field will be omitted. |
blockStatus[@positionTimestamp] | Time of the last position of the vehicle. Will be null if no position is available. |
blockStatus[@deviation] | Integer deviation from schedule of the block according to its last position measured in seconds. If no usable position is found this value will be null. |
blockStatus[@vehicleID] | Integer ID of the vehicle serving the block. If no vehicle is reporting on the block this value will be null. |
blockStatus[@schedulePosition] | Position in schedule of the vehicle serving this block as a time value.
If no vehicle is reporting on the block this value will be null. For example if a vehicle is 5 minutes late at 12:30pm, it's schedulePosition will be 12:25pm. |
trip | Child element of blockStatus. Contains information about a trip relevant for the block, documented on the tripStatus page. |
route | Contains information about a route, documented on the routeConfig page. |
location | Contains information about a stop |
location[@desc] | The public location description of the stop. |
location[@dir] | The direction of traffic at the stop. The cardinal directions of a compass. For bidirectional rail platforms the value will be blank. |
location[@lat] | The latitude of the stop. |
location[@lng] | The longitude of the stop. |
location[@locid] | LocationID of the stop. |
location[@passengerCode] | Passenger access code for the stop. 'E' = Either boarding or alighting 'A' = Alighting only 'B' = Boarding only 'N' = Neither boarding nor alighting |