Skip to content

Commit 8aaa96c

Browse files
authored
Merge pull request #826 from openmobilityfoundation/feature-smarter-scooters
Agency/Provider adjustments for Modes
2 parents d5337ea + 58fccf9 commit 8aaa96c

10 files changed

Lines changed: 384 additions & 294 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ You can read more in our **[Understanding the different MDS APIs](https://github
8282

8383
## GBFS Requirement
8484

85-
All MDS compatible Provider and/or Agency feeds [must also expose](/provider/README.md#gbfs) a public [GBFS](https://github.com/NABSA/gbfs) feed for the micromobility and car share [modes](/modes) (passenger services and delivery robots may be optionally supported at the discretion of the agency running the program). Compatibility with [GBFS 2.2](https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md) or greater is advised, or the version recommended per MobilityData's [supported releases](https://github.com/MobilityData/gbfs#past-version-releases) guidance. See our [MDS Vehicles Guide](https://github.com/openmobilityfoundation/mobility-data-specification/wiki/MDS-Vehicles) for how MDS Provider/Agency `/devices` can be used by regulators instead of the public GBFS `/free_bike_status`. Additional information on MDS and GBFS can be found in this [guidance document](https://github.com/openmobilityfoundation/governance/blob/main/technical/GBFS_and_MDS.md).
85+
All MDS compatible Provider and/or Agency feeds must also expose a public [GBFS](https://github.com/NABSA/gbfs) feed for the micromobility and car share [modes](/modes) (passenger services and delivery robots may be optionally supported at the discretion of the agency running the program). Compatibility with [GBFS 2.2](https://github.com/NABSA/gbfs/blob/v2.2/gbfs.md) or greater is advised, or the version recommended per MobilityData's [supported releases](https://github.com/MobilityData/gbfs#past-version-releases) guidance. See our [MDS Vehicles Guide](https://github.com/openmobilityfoundation/mobility-data-specification/wiki/MDS-Vehicles) for how MDS Provider/Agency `/vehicles` can be used by regulators instead of the public GBFS `/free_bike_status`. Additional information on MDS and GBFS can be found in this [guidance document](https://github.com/openmobilityfoundation/governance/blob/main/technical/GBFS_and_MDS.md).
8686

8787
[Top][toc]
8888

agency/README.md

Lines changed: 61 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,30 @@
22

33
<a href="/agency/"><img src="https://i.imgur.com/HzMWtaI.png" width="120" align="right" alt="MDS Agency Icon" border="0"></a>
44

5-
The Agency API endpoints are intended to be implemented by regulatory agencies and consumed by mobility providers. Providers query the Agency API when events (such as a trip start or vehicle status change) occur in their systems.
5+
The Agency API endpoints are intended to be implemented by regulatory agencies and consumed by mobility providers. Data is **pushed** to agencies by providers. Providers query the Agency API when events (such as a trip start or vehicle status change) occur in their systems.
66

77
This specification contains a collection of RESTful APIs used to specify the digital relationship between *mobility as a service* providers and the agencies that regulate them.
88

99
## Table of Contents
1010

1111
* [General Information](#general-information)
1212
* [Versioning](#versioning)
13+
* [Modes](#modes)
1314
* [Responses and Error Messages](#responses-and-error-messages)
1415
* [Authorization](#authorization)
1516
* [GBFS](#gbfs)
1617
* [Vehicles](#vehicles)
1718
* [Vehicle - Register](#vehicle---register)
1819
* [Vehicle - Update](#vehicle---update)
19-
* [Vehicle - Events](#vehicle---event)
20-
* [Vehicle - Telemetry](#vehicle---telemetry)
20+
* [Vehicles - Events](#vehicles---events)
21+
* [Vehicles - Telemetry](#vehicles---telemetry)
22+
* [Trips](#trips)
2123
* [Stops](#stops)
2224
* [Stops - Register](#stops---register)
2325
* [Stops - Update](#stops---update)
2426
* [Stops - Readback](#stops---readback)
27+
* [Reports](#reports)
28+
* [Reports - Register](#reports---register)
2529

2630
## General information
2731

@@ -39,7 +43,7 @@ Versioning must be implemented as specified in the [Versioning section][versioni
3943

4044
### Modes
4145

42-
MDS is intended to be used for multiple transportation modes, including its original micromobility (e-scooters, bikes, etc.) as well as additional modes such as taxis and delivery bots. A given `provider_id` shall be associated with a single mobility [mode], so that the mode does not have to be specified in each data structure and API call. A provider implementing more than one mode shall [register](/README.md#providers-using-mds) a `provider_id` for each mode.
46+
MDS is intended to be used for multiple transportation modes, including its original micromobility (e-scooters, bikes, etc.) as well as additional modes such as taxis and delivery bots. A given `provider_id` shall be associated with a single mobility [mode][modes], so that the mode does not have to be specified in each data structure and API call. A provider implementing more than one mode shall [register](/README.md#providers-using-mds) a `provider_id` for each mode.
4347

4448
[Top][toc]
4549

@@ -108,6 +112,8 @@ The `/vehicles` registration endpoint is used to register vehicles for use in th
108112

109113
See [Bulk Responses](#bulk-responses)
110114

115+
[Top][toc]
116+
111117
### Vehicle Register Error Codes:
112118

113119
| `error` | `error_description` | `error_details`[] |
@@ -185,6 +191,31 @@ See [Bulk Responses](#bulk-responses)
185191

186192
[Top][toc]
187193

194+
## Trips
195+
196+
The Trips endpoint serves two purposes:
197+
198+
* Definitively indicating that a Trip (a sequence of events linked by a trip_id) has been completed. For example, from analyzing only the raw Vehicle Events feed, if a trip crosses an Agency's jurisdictional boundaries but does not end within the jurisdiction (last event_type seen is a `leave_jurisdiction`), this can result in a 'dangling trip'. The Trips endpoint satisfies this concern, by acting as a final indication that a trip has been finished, even if it ends outside of jurisdictional boundaries; if a trip has intersected an Agency's jurisdictional boundaries at all during a trip, it is expected that a Provider will send a Trip payload to the Agency following the trip's completion.
199+
* Providing information to an Agency regarding an entire trip, without extending any of the Vehicle Event payloads, or changing any requirements on when Vehicle Events should be sent.
200+
201+
**Endpoint:** `/trips`
202+
**Method:** `POST`
203+
**Payload:** Array of [Trips](#trip-data)
204+
205+
200 Success Response:
206+
207+
See [Bulk Responses](#bulk-responses)
208+
209+
### Trip Errors:
210+
211+
| `error` | `error_description` | `error_details`[] |
212+
| -------------------- | ------------------------------------------------- | ------------------------------- |
213+
| `bad_param` | A validation error occurred | Array of parameters with errors |
214+
| `missing_param` | A required parameter is missing | Array of missing parameters |
215+
| `unregistered` | This `device_id` is unregistered | |
216+
217+
[Top][toc]
218+
188219
## Stops
189220

190221
### Stops - Register
@@ -209,6 +240,8 @@ See [Bulk Responses](#bulk-responses)
209240

210241
403 Unauthorized Response:
211242

243+
**None**
244+
212245
[Top][toc]
213246

214247
### Stops - Update
@@ -235,6 +268,8 @@ See [Bulk Responses](#bulk-responses)
235268
| `missing_param` | A required parameter is missing | Array of missing parameters |
236269
| `unregistered` | No stop with `stop_id` is already registered | |
237270

271+
[Top][toc]
272+
238273
### Stops - Readback
239274

240275
**Endpoint:** `/stops/:stop_id`
@@ -253,29 +288,37 @@ If `stop_id` is specified, `GET` will return an array with a single stop record,
253288

254289
[Top][toc]
255290

256-
## Trips
291+
## Reports
257292

258-
The Trips endpoint serves two purposes:
293+
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.
259294

260-
* Definitively indicating that a Trip (a sequence of events linked by a trip_id) has been completed. For example, from analyzing only the raw Vehicle Events feed, if a trip crosses an Agency's jurisdictional boundaries but does not end within the jurisdiction (last event_type seen is a `leave_jurisdiction`), this can result in a 'dangling trip'. The Trips endpoint satisfies this concern, by acting as a final indication that a trip has been finished, even if it ends outside of jurisdictional boundaries; if a trip has intersected an Agency's jurisdictional boundaries at all during a trip, it is expected that a Provider will send a Trip payload to the Agency following the trip's completion.
261-
* Providing information to an Agency regarding an entire trip, without extending any of the Vehicle Event payloads, or changing any requirements on when Vehicle Events should be sent.
295+
The authenticated reports are monthly, historic flat files that may be pre-generated by the provider.
262296

263-
**Endpoint:** `/trips`
297+
[Top][toc]
298+
299+
## Reports - register
300+
301+
The `/reports` endpoint allows an agency to register aggregated report counts in CSV structure.
302+
303+
**Endpoint:** `/reports`
264304
**Method:** `POST`
265-
**Payload:** Array of [Trips](#trip-data)
305+
**Payload**: A CSV of [Reports][reports]
266306

267307
200 Success Response:
268308

269309
See [Bulk Responses](#bulk-responses)
270310

271-
### Trip Errors:
311+
#### Reports Register Errors:
272312

273313
| `error` | `error_description` | `error_details`[] |
274314
| -------------------- | ------------------------------------------------- | ------------------------------- |
275315
| `bad_param` | A validation error occurred | Array of parameters with errors |
276316
| `missing_param` | A required parameter is missing | Array of missing parameters |
277-
| `unregistered` | This `device_id` is unregistered | |
317+
| `already_registered` | A stop with `stop_id` is already registered | |
278318

319+
403 Unauthorized Response:
320+
321+
**None**
279322

280323
[Top][toc]
281324

@@ -287,15 +330,16 @@ See [Bulk Responses](#bulk-responses)
287330
[error-messages]: /general-information.md#error-messages
288331
[hdop]: https://en.wikipedia.org/wiki/Dilution_of_precision_(navigation)
289332
[modes]: /modes/README.md
290-
[propulsion-types]: /general-information.md#propulsion-types
333+
[propulsion-types]: /data_types.md#propulsion-types
334+
[reports]: /data_types.md#reports
291335
[responses]: /general-information.md#responses
292-
[stops]: /general-information.md#stops
293-
[telemetry-data]: /general-information.md#telemetry-data
294-
[trip-data]: /general-information.md#trips
336+
[stops]: /data_types.md#stops
337+
[telemetry-data]: /data_types.md#telemetry
338+
[trip-data]: /data_types.md#trips
295339
[toc]: #table-of-contents
296340
[ts]: /general-information.md#timestamps
297341
[vehicle]: /data-types.md#vehicles
298-
[vehicle-types]: /general-information.md#vehicle-types
342+
[vehicle-types]: /data_types.md#vehicle-types
299343
[vehicle-states]: /modes/vehicle_states.md
300344
[vehicle-event-types]: /modes/event_types.md
301345
[vehicle-event]: /data-types.md#events

0 commit comments

Comments
 (0)