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
@@ -91,6 +90,17 @@ See the [GBFS Requirement](/README.md#gbfs-requirement) language for more detail
91
90
92
91
[Top][toc]
93
92
93
+
### Data Latency Requirements
94
+
95
+
The data returned by a near-realtime endpoint should be as close to realtime as possible, but in no case should it be more than 5 minutes out-of-date. Near-realtime endpoints must contain `last_updated` and `ttl` properties in the top-level of the response body. These properties are defined as:
96
+
97
+
Field Name | Required | Defines
98
+
--------------------| ----------| ----------
99
+
last_updated | Yes | Timestamp indicating the last time the data in this feed was updated
100
+
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).
101
+
102
+
[Top][toc]
103
+
94
104
### JSON Schema
95
105
96
106
MDS defines [JSON Schema][json-schema] files for each endpoint.
@@ -251,6 +261,29 @@ Trips that start or end at a [Stop][stops] must include a `stop_id` property in
251
261
252
262
[Top][toc]
253
263
264
+
## Telemetry
265
+
266
+
The `/telemetry` endpoint is a feed of vehicle telemetry data for publishing all available location data. For privacy reasons, in-trip telemetry may be delayed at the discretion of the regulating body.
267
+
268
+
Unless stated otherwise by the municipality, this endpoint must return only those telemetry that [intersects][intersection] with the [municipality boundary][muni-boundary].
269
+
270
+
> Note: As a result of this definition, consumers should query the [trips endpoint][trips] to infer when vehicles enter or leave the municipality boundary.
271
+
272
+
**Endpoint:**`/telemetry`
273
+
**Method:**`GET`
274
+
**Schema:**[`telemetry` schema][telemetry-schema]
275
+
**`data` Payload:**`{ "telemetry": [] }`, an array of `telemetry` objects
276
+
277
+
### Telemetry - Query Parameters
278
+
279
+
| Parameter | Format | Expected Output |
280
+
| --------- | ------ | --------------- |
281
+
|`telemetry_time`|`YYYY-MM-DDTHH`, an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended datetime representing an UTC hour between 00 and 23. | All telemetry with timestamp occurring within the hour. For example, requesting `telemetry_time=2019-10-01T07` returns all telemetry where `2019-10-01T07:00:00 <= telemetry.timestamp < 2019-10-01T08:00:00` UTC. |
282
+
283
+
Without a `telemetry_time` query parameter, `/telemetry` shall return a `400 Bad Request` error.
284
+
285
+
[Top][toc]
286
+
254
287
## Events
255
288
256
289
The `/events/recent` and `/events/historical/` endpoints return a list of Event objects, describing the activity of the Provider's vehicles. Recent events are at most two weeks old and can be queried with start/stop time, and historical events are packaged in hour-sized chunks for ease of implementation.
@@ -316,7 +349,7 @@ See also [Stop-based Geographic Data][stop-based-geo].
316
349
**Schema:** [`events` schema][events-schema]
317
350
**`data` Payload:** `{ "events": [] }`, an array of Event objects
318
351
319
-
#### Recent Events Query Parameters
352
+
#### Recent Events - Query Parameters
320
353
321
354
The Recent Events API requires two parameters:
322
355
@@ -331,44 +364,34 @@ Should either side of the requested time range be greater than 2 weeks before th
331
364
332
365
[Top][toc]
333
366
334
-
## Reports
367
+
## Vehicles
335
368
336
-
Reports are information that providers can send back to agencies containing aggregated data that is not contained within other MDS endpoints, like counts of special groups of riders. These supplemental reports are not a substitute for other MDS Provider endpoints.
337
-
338
-
The authenticated reports are monthly, historic flat files that may be pre-generated by the provider.
339
-
340
-
### Reports - Response
341
-
342
-
**Endpoint:** `/reports`
343
-
**Method:** `GET`
344
-
**[Beta feature][beta]:** No (as of 2.0.0). [Leave feedback](https://github.com/openmobilityfoundation/mobility-data-specification/issues/672)
345
-
**Usage note:** This endpoint uses media-type `text/vnd.mds+csv` instead of `application/vnd.mds+json`, see [Versioning][versioning].
346
-
**Schema:** TBD
347
-
**`data` Filename:** monthly file named by year and month, e.g. `/reports/YYYY-MM.csv`
348
-
**`data` Payload:** monthly CSV files of [Report](/data-types.md#Reports) objects
349
-
350
-
[Top][toc]
351
-
352
-
### Reports - Example
353
-
354
-
See [Provider examples](examples.md#reports).
355
-
356
-
[Top][toc]
369
+
The `/vehicles` is a near-realtime endpoint and returns the current status of vehicles in an agency's [Jurisdiction](/general-information.md#definitions) and/or area of agency responsibility. All vehicles that are currently in any [`vehicle_state`][vehicle-states] should be returned in this payload. Since all states are returned, care should be taken to filter out states not in the [PROW](/general-information.md#definitions) if doing vehicle counts. For the states `elsewhere` and `removed` which include vehicles not in the [PROW](/general-information.md#definitions) but provide some operational clarity for agencies, these must only persist in the feed for 90 minutes before being removed.
357
370
358
-
## Realtime Data
371
+
As with other MDS APIs, `/vehicles` is intended for use by regulators, not by the general public. `/vehicles` can be deployed by providers as a standalone MDS endpoint for agencies without requiring the use of other endpoints, due to the [modularity](/README.md#modularity) of MDS. See our [MDS Vehicles Guide](https://github.com/openmobilityfoundation/mobility-data-specification/wiki/MDS-Vehicles) for how this compares to GBFS `/free_bike_status`. Note that using authenticated `/vehicles` does not replace the role of a public [GBFS][gbfs] feed in enabling consumer-facing applications. If a provider is using both `/vehicles` and GBFS endpoints, the `/vehicles` endpoint should be considered source of truth regarding an agency's compliance checks.
359
372
360
-
### Data Latency Requirements
373
+
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 in accordance with the [Data Latency Requirements][data-latency]:
361
374
362
-
The data returned by a near-realtime endpoint should be as close to realtime as possible, but in no case should it be more than 5 minutes out-of-date. Near-realtime endpoints must contain `last_updated` and `ttl` properties in the top-level of the response body. These properties are defined as:
375
+
```json
376
+
{
377
+
"version": "x.y.z",
378
+
"data": {
379
+
"vehicles": []
380
+
},
381
+
"last_updated": "12345",
382
+
"ttl": "12345"
383
+
}
384
+
```
363
385
364
-
Field Name | Required | Defines
365
-
--------------------| ----------| ----------
366
-
last_updated | Yes | Timestamp indicating the last time the data in this feed was updated
367
-
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).
386
+
**Endpoint:**`/vehicles`
387
+
**Method:**`GET`
388
+
**[Beta feature][beta]:** No (as of 1.2.0)
389
+
**Schema:**[`vehicles` schema][vehicles-schema]
390
+
**`data` Payload:**`{ "vehicles": [] }`, an array of [Vehicle](vehicle) objects
368
391
369
392
[Top][toc]
370
393
371
-
### Stops
394
+
## Stops
372
395
373
396
Stop information should be updated on a near-realtime basis by providers who operate _docked_ mobility devices in a given municipality.
374
397
@@ -395,53 +418,27 @@ In the case that a `stop_id` query parameter is specified, the `stops` array ret
395
418
396
419
[Top][toc]
397
420
398
-
### Telemetry
421
+
##Reports
399
422
400
-
The `/telemetry` endpoint is a feed of vehicle telemetry data for publishing all available location data. For privacy reasons, in-trip telemetry may be delayed at the discretion of the regulating body.
423
+
Reports are information that providers can send back to agencies containing aggregated data that is not contained within other MDS endpoints, like counts of special groups of riders. These supplemental reports are not a substitute for other MDS Provider endpoints.
401
424
402
-
Unless stated otherwise by the municipality, this endpoint must return only those telemetry that [intersects][intersection] with the [municipality boundary][muni-boundary].
425
+
The authenticated reports are monthly, historic flat files that may be pre-generated by the provider.
403
426
404
-
> Note: As a result of this definition, consumers should query the [trips endpoint][trips] to infer when vehicles enter or leave the municipality boundary.
427
+
### Reports - Response
405
428
406
-
**Endpoint:**`/telemetry`
429
+
**Endpoint:**`/reports`
407
430
**Method:**`GET`
408
-
**Schema:**[`telemetry` schema][telemetry-schema]
409
-
**`data` Payload:**`{ "telemetry": [] }`, an array of `telemetry` objects
410
-
411
-
#### Telemetry - Query Parameters
412
-
413
-
| Parameter | Format | Expected Output |
414
-
| --------- | ------ | --------------- |
415
-
|`telemetry_time`|`YYYY-MM-DDTHH`, an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended datetime representing an UTC hour between 00 and 23. | All telemetry with timestamp occurring within the hour. For example, requesting `telemetry_time=2019-10-01T07` returns all telemetry where `2019-10-01T07:00:00 <= telemetry.timestamp < 2019-10-01T08:00:00` UTC. |
416
-
417
-
Without a `telemetry_time` query parameter, `/telemetry` shall return a `400 Bad Request` error.
431
+
**[Beta feature][beta]:** No (as of 2.0.0). [Leave feedback](https://github.com/openmobilityfoundation/mobility-data-specification/issues/672)
432
+
**Usage note:** This endpoint uses media-type `text/vnd.mds+csv` instead of `application/vnd.mds+json`, see [Versioning][versioning].
433
+
**Schema:** TBD
434
+
**`data` Filename:** monthly file named by year and month, e.g. `/reports/YYYY-MM.csv`
435
+
**`data` Payload:** monthly CSV files of [Report](/data-types.md#Reports) objects
418
436
419
437
[Top][toc]
420
438
421
-
### Vehicles
422
-
423
-
The `/vehicles` is a near-realtime endpoint and returns the current status of vehicles in an agency's [Jurisdiction](/general-information.md#definitions) and/or area of agency responsibility. All vehicles that are currently in any [`vehicle_state`][vehicle-states] should be returned in this payload. Since all states are returned, care should be taken to filter out states not in the [PROW](/general-information.md#definitions) if doing vehicle counts. For the states `elsewhere` and `removed` which include vehicles not in the [PROW](/general-information.md#definitions) but provide some operational clarity for agencies, these must only persist in the feed for 90 minutes before being removed.
424
-
425
-
As with other MDS APIs, `/vehicles` is intended for use by regulators, not by the general public. `/vehicles` can be deployed by providers as a standalone MDS endpoint for agencies without requiring the use of other endpoints, due to the [modularity](/README.md#modularity) of MDS. See our [MDS Vehicles Guide](https://github.com/openmobilityfoundation/mobility-data-specification/wiki/MDS-Vehicles) for how this compares to GBFS `/free_bike_status`. Note that using authenticated `/vehicles` does not replace the role of a public [GBFS][gbfs] feed in enabling consumer-facing applications. If a provider is using both `/vehicles` and GBFS endpoints, the `/vehicles` endpoint should be considered source of truth regarding an agency's compliance checks.
426
-
427
-
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 in accordance with the [Data Latency Requirements][data-latency]:
428
-
429
-
```json
430
-
{
431
-
"version": "x.y.z",
432
-
"data": {
433
-
"vehicles": []
434
-
},
435
-
"last_updated": "12345",
436
-
"ttl": "12345"
437
-
}
438
-
```
439
+
### Reports - Example
439
440
440
-
**Endpoint:**`/vehicles`
441
-
**Method:**`GET`
442
-
**[Beta feature][beta]:** No (as of 1.2.0)
443
-
**Schema:**[`vehicles` schema][vehicles-schema]
444
-
**`data` Payload:**`{ "vehicles": [] }`, an array of [Vehicle](vehicle) objects
0 commit comments