Skip to content

Commit 58fccf9

Browse files
committed
Added individual vehicle lookup to Provider
1 parent e01dc83 commit 58fccf9

2 files changed

Lines changed: 38 additions & 8 deletions

File tree

data-types.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ A vehicle record is as follows:
2626
| `device_id` | UUID | Required | A unique device ID in UUID format, should match this device in Provider |
2727
| `provider_id` | UUID | Required | A UUID for the Provider, unique within MDS. See MDS [provider list](/providers.csv). |
2828
| `data_provider_id` | UUID | Optional | If different than `provider_id`, a UUID for the data solution provider managing the data feed in this endpoint. See MDS [provider list](/providers.csv) which includes both service operators and data solution providers. |
29-
| `vehicle_id` | String | Required | A unique vehicle identifier (visible code, license plate, etc), visible on the vehicle itself |
29+
| `vehicle_id` | String | Required | A unique vehicle identifier (visible code, license plate, etc), visible on the vehicle itself |
3030
| `vehicle_type` | Enum | Required | The [vehicle type][vehicle-types] |
31-
| `vehicle_attributes` | Array | Optional |**[Mode](/modes#list-of-supported-modes) Specific**. [Vehicle attributes](/modes#vehicle-attributes) given as mode-specific unordered key-value pairs |
31+
| `vehicle_attributes` | Array | Optional | **[Mode](/modes#list-of-supported-modes) Specific**. [Vehicle attributes](/modes#vehicle-attributes) given as mode-specific unordered key-value pairs |
3232
| `propulsion_types` | Enum[] | Required | Array of [propulsion types][propulsion-types]; allows multiple values |
3333
| `accessibility_options` | Enum[] | Required | **[Mode](/modes#list-of-supported-modes) Specific**. [Accessibility options](/modes#accessibility-options) given as an array of enumerated values. List of any accessibility options **available on the vehicle**. |
3434
| `battery_capacity` | Integer | Required if Available | Capacity of battery expressed as milliamp hours (mAh) |
@@ -135,7 +135,7 @@ A standard point of vehicle telemetry. References to latitude and longitude impl
135135
| `heading` | Double | Required if Available | Degrees - clockwise starting at 0 degrees at true North |
136136
| `speed` | Float | Required if Available | Estimated speed in meters / sec as reported by the GPS chipset |
137137
| `horizontal_accuracy` | Float | Required if Available | Horizontal accuracy, in meters |
138-
| `vertical_accuracy` | Float | Required if Available | Horizontal accuracy, in meters |
138+
| `vertical_accuracy` | Float | Required if Available | Vertical accuracy, in meters |
139139
| `satellites` | Integer | Required if Available | Number of GPS or GNSS satellites |
140140

141141
[Top][toc]
@@ -286,6 +286,7 @@ Other special group types may be added in future MDS releases as relevant agency
286286
[gbfs-station-status]: https://github.com/NABSA/gbfs/blob/master/gbfs.md#station_statusjson
287287
[general-stops]: /general-information.md#stops
288288
[geo]: #geographic-data
289+
[geography-driven-events]: /general-information.md#geography-driven-events
289290
[gps]: #gps-data
290291
[iso4217]: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
291292
[modes]: /modes/README.md
@@ -294,6 +295,7 @@ Other special group types may be added in future MDS releases as relevant agency
294295
[provider]: /provider/README.md
295296
[point-geo]: #geographic-telemetry-data
296297
[stop-based-geo]: #stop-based-geographic-data
298+
[stops]: #stops
297299
[st-intersects]: https://postgis.net/docs/ST_Intersects.html
298300
[toc]: #table-of-contents
299301
[ts]: /general-information.md#timestamps

provider/README.md

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ This specification contains a data standard for *mobility as a service* provider
1818
* [Pagination](#pagination)
1919
* [Municipality Boundary](#municipality-boundary)
2020
* [Other Data Types](#other-data-types)
21-
* [Vehicles][vehicles]
22-
* [Trips][#trips]
21+
* [Vehicles](#vehicles)
22+
* [Trips](#trips)
2323
* [Trips - Query Parameters](#trips---query-parameters)
2424
* [Trips - Responses](#trips---responses)
2525
* [Routes](#routes)
26-
* [Telemetry][telemetry]
26+
* [Telemetry](#telemetry)
2727
* [Telemetry - Query Parameters](#telemetry---query-parameters)
28-
* [Events][events]
28+
* [Events](#events)
2929
* [Historical Events - Query Parameters](#historical-events---query-parameters)
3030
* [Historical Events - Responses](#historical-events---responses)
3131
* [Recent Events](#recent-events)
@@ -178,12 +178,40 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
178178
}
179179
```
180180

181-
**Endpoint:** `/vehicles`
181+
The `/vehicles` endpoint returns the specified vehicle (if a device_id is provided) or a list of known vehicles.
182+
183+
**Endpoint:** `/vehicles/{device_id}`
182184
**Method:** `GET`
183185
**[Beta feature][beta]:** No (as of 1.2.0)
184186
**Schema:** [`vehicles` schema][vehicles-schema]
185187
**`data` Payload:** `{ "vehicles": [] }`, an array of [Vehicle](vehicle) objects
186188

189+
Path Params:
190+
191+
| Param | Type | Required/Optional | Description |
192+
| ------------ | ---- | ----------------- | ------------------------------------------- |
193+
| `device_id` | UUID | Optional | If provided, retrieve the specified vehicle |
194+
195+
200 Success Response:
196+
197+
If `device_id` is specified, `GET` will return an array with a single vehicle record, otherwise it will be a list of vehicle records with pagination details per the [JSON API](https://jsonapi.org/format/#fetching-pagination) spec:
198+
199+
```json
200+
{
201+
"vehicles": [ ... ]
202+
"links": {
203+
"first": "https://...",
204+
"last": "https://...",
205+
"prev": "https://...",
206+
"next": "https://..."
207+
}
208+
}
209+
```
210+
211+
404 Failure Response:
212+
213+
_No content returned on vehicle not found._
214+
187215
[Top][toc]
188216

189217
## Trips

0 commit comments

Comments
 (0)