You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: provider/README.md
+49-2Lines changed: 49 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ This specification contains a data standard for *mobility as a service* provider
10
10
*[Realtime Data](#realtime-data)
11
11
*[GBFS](#GBFS)
12
12
*[Events](#events)
13
+
*[Vehicles](#vehicles)
13
14
14
15
## General Information
15
16
@@ -395,12 +396,58 @@ Should either side of the requested time range be missing, `/events` shall retur
395
396
396
397
Should either side of the requested time range be greater than 2 weeks before the time of the request, `/events` shall return a `400 Bad Request` error.
397
398
399
+
### Vehicles
400
+
401
+
The `/vehicles` endpoint returns the current status of vehicles on the PROW. Only vehicles that are currently in available, unavailable, or reserved states should be returned in this payload. Data in this endpoint should reconcile with data from the `/status_changes` enpdoint. The data returned by this endpoint should be as close to realtime as possible, but in no case should it be more than 5 minutes out-of-date.
402
+
403
+
In addition to the standard [Provider payload wrapper](#response-format), responses from this endpoint should contain the last update timestamp and amount of time until the next update:
404
+
405
+
```json
406
+
{
407
+
"version": "x.y.z",
408
+
"data": {
409
+
"vehicles": []
410
+
},
411
+
"last_updated": "12345",
412
+
"ttl": "12345"
413
+
}
414
+
```
415
+
416
+
Where `last_updated` and `ttl` are defined as follows:
417
+
418
+
Field Name | Required | Defines
419
+
--------------------| ----------| ----------
420
+
last_updated | Yes | Timestamp indicating the last time the data in this feed was updated
421
+
ttl | Yes | Integer representing the number of milliseconds before the data in this feed will be updated again (0 if the data should always be refreshed).
422
+
423
+
**Endpoint:**`/vehicles`
424
+
**Method:**`GET`
425
+
**Required/Optional:** Optional starting with `0.4.1`, moving to Required in a future version (`0.5.0`+)
426
+
**Schema:**[`vehicles` schema][vehicles-schema]
427
+
**`data` Payload:**`{ "vehicles": [] }`, an array of objects with the following structure
428
+
429
+
| Field | Type | Required/Optional | Comments |
430
+
| ----- | ---- | ----------------- | ----- |
431
+
|`provider_id`| UUID | Required | A UUID for the Provider, unique within MDS |
432
+
|`provider_name`| String | Required | The public-facing name of the Provider |
433
+
|`device_id`| UUID | Required | A unique device ID in UUID format, should match this device in Provider |
434
+
|`vehicle_id`| String | Required | The Vehicle Identification Number visible on the vehicle itself, should match this device in provider |
435
+
|`vehicle_type`| Enum | Required | see [vehicle types](#vehicle-types) table |
|`last_event_time`|[timestamp][ts]| Required | Date/time when last status change occurred. See [Event Times](#event-times)|
438
+
|`last_event_type`| Enum | Required | Event type of most recent status change. See [event types](#event-types) table |
439
+
|`last_event_type_reason`| Enum | Required | Event type reason of most recent status change, allowable values determined by [`event type`](#event-types)|
440
+
|`last_event_location`| GeoJSON [Point Feature][geo]| Required | Location of vehicle's last event |
441
+
|`current_location`| GeoJSON [Point Feature][geo]| Required if Applicable | Current location of vehicle if different from last event, and the vehicle is not currently on a trip |
442
+
|`battery_pct`| Float | Required if Applicable | Percent battery charge of device, expressed between 0 and 1 |
0 commit comments