Skip to content

Commit 2a74fa4

Browse files
authored
Merge pull request #7 from openmobilityfoundation/dev
update Dev
2 parents 6690ac7 + 7a97406 commit 2a74fa4

22 files changed

Lines changed: 1987 additions & 466 deletions

.github/PULL_REQUEST_TEMPLATE/default.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ title: <Insert Title>
99

1010
Thank you for your contribution!
1111

12-
*For most Pull Requests, the target branch should be [**`dev`**](https://github.com/openmobilityfoundation/mobility-data-specification/tree/dev). Please ensure you are targeting **`dev`** to avoid complications and help make the Review process as smooth as possible.*
12+
To avoid complications and help make the Review process as smooth as possible, make sure to:
13+
14+
1. Target [**`dev`**](https://github.com/openmobilityfoundation/mobility-data-specification/tree/dev) branch. Please ensure you are targeting **`dev`**, not **`main`**.
15+
1. Keep the *"Allow edits from maintainers"* button checked to help us resolve some issues for you.
16+
1. Be ready to resolve any merge conflicts before we approve your Pull Request.
1317

1418
## Explain pull request
1519

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ for Shareable Dockless Mobility Device Permit Holders](https://www.atlantaga.gov
7676
* **Ulm, Germany**: A draft of the guidelines can be found at [the city's GitHub presence](https://github.com/stadtulm/mds-zonen).
7777
* **Washington, DC**: [Dockless Vehicle Permits](https://ddot.dc.gov/page/dockless-vehicle-permits-district), [terms and conditions](https://ddot.dc.gov/sites/default/files/dc/sites/ddot/2019.11.6%20Shared%20dockless%202020%20Terms%20and%20Conditions%20scooter.pdf), [data reporting standards](https://ddot.dc.gov/sites/default/files/dc/sites/ddot/2019.11.6%20Dockless%20Permit%20TC%20Attatchments.pdf), and [FAQ](https://docs.google.com/document/d/1G2ddANcXl3lShCZInV3uX2NTBfRRu4Fm-tiaCi203QM/).
7878

79-
* _[add your City here by opening a pull request](https://github.com/openmobilityfoundation/mobility-data-specification/compare)_
79+
* _add a city here by [opening a pull request](https://github.com/openmobilityfoundation/mobility-data-specification/compare/dev...dev) or [making an issue](https://github.com/openmobilityfoundation/mobility-data-specification/issues/new?assignees=&labels=&template=feature-request---proposal.md&title=)_.
8080

8181
Other cities include Baltimore, Bellevue, Charlotte, Oakland, and Seattle, via the [NACTO Guidelines for Regulating Shared Micromobility](https://nacto.org/wp-content/uploads/2019/09/NACTO_Shared_Micromobility_Guidelines_Web.pdf), page 48.
8282

agency/README.md

Lines changed: 77 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,46 @@
22

33
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.
44

5-
* Date: 19 Sep 2019
6-
* Version: BETA
7-
85
## Table of Contents
96

107
* [General Information](#general-information)
8+
* [Versioning](#versioning)
9+
* [Responses and Error Messages](#responses-and-error-messages)
10+
* [Authorization](#authorization)
1111
* [Vehicles](#vehicles)
12-
* [Vehicle Registration](#vehicle---register)
13-
* [Vehicle Update](#vehicle---update)
14-
* [Vehicle Events](#vehicle---event)
15-
* [Vehicles Telemetry](#vehicles---telemetry)
12+
* [Vehicle - Register](#vehicle---register)
13+
* [Vehicle - Update](#vehicle---update)
14+
* [Vehicle - Events](#vehicle---event)
15+
* [Vehicle - Telemetry](#vehicle---telemetry)
1616
* [Telemetry Data](#telemetry-data)
1717
* [Stops](#stops)
1818

1919
## General information
2020

2121
This specification uses data types including timestamps, UUIDs, and vehicle state definitions as described in the MDS [General Information][general] document.
2222

23+
[Top][toc]
24+
2325
### Versioning
2426

2527
`agency` APIs must handle requests for specific versions of the specification from clients.
2628

2729
Versioning must be implemented as specified in the [Versioning section][versioning].
2830

31+
[Top][toc]
32+
2933
### Responses and Error Messages
3034

3135
See the [Responses][responses] and [Error Messages][error-messages] sections.
3236

37+
[Top][toc]
38+
3339
### Authorization
3440

3541
When making requests, the Agency API expects `provider_id` to be part of the claims in a [JWT](https://jwt.io/) `access_token` in the `Authorization` header, in the form `Authorization: Bearer <access_token>`. The token issuance, expiration and revocation policies are at the discretion of the Agency.
3642

43+
[Top][toc]
44+
3745
## Vehicles
3846

3947
The `/vehicles` endpoint returns the specified vehicle (if a device_id is provided) or a list of known vehicles. Providers can only retrieve data for vehicles in their registered fleet.
@@ -49,7 +57,7 @@ Path Params:
4957

5058
200 Success Response:
5159

52-
If `device_id` is specified, `GET` will return 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:
60+
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:
5361

5462
```json
5563
{
@@ -83,7 +91,9 @@ A vehicle record is as follows:
8391

8492
_No content returned on vehicle not found._
8593

86-
## Vehicle Registration
94+
[Top][toc]
95+
96+
## Vehicle - Register
8797

8898
The `/vehicles` registration endpoint is used to register a vehicle for use in the Agency jurisdiction.
8999

@@ -120,6 +130,8 @@ _No content returned on success._
120130
| -------------------- | ------------------------------------------------- | ------------------------------- |
121131
| `already_registered` | A vehicle with `device_id` is already registered | |
122132

133+
[Top][toc]
134+
123135
## Vehicle - Update
124136

125137
The `/vehicles` update endpoint is used to update some mutable aspect of a vehicle. For now, only `vehicle_id`.
@@ -148,6 +160,8 @@ _No content returned on success._
148160

149161
_No content returned if no vehicle matching `device_id` is found._
150162

163+
[Top][toc]
164+
151165
## Vehicle - Event
152166

153167
The vehicle `/event` endpoint allows the Provider to control the state of the vehicle including deregister a vehicle from the fleet.
@@ -159,7 +173,7 @@ Path Params:
159173

160174
| Field | Type | Required/Optional | Field Description |
161175
| ------------ | ---- | ----------------- | ---------------------------------------- |
162-
| `device_id` | UUID | Required | ID used in [Register](#vehicle-register) |
176+
| `device_id` | UUID | Required | ID used in [Register](#vehicle---register) |
163177

164178
Body Params:
165179

@@ -185,7 +199,9 @@ Body Params:
185199
| `missing_param` | A required parameter is missing | Array of missing parameters |
186200
| `unregistered` | Vehicle is not registered | |
187201

188-
## Vehicles - Telemetry
202+
[Top][toc]
203+
204+
## Vehicle - Telemetry
189205

190206
The vehicle `/telemetry` endpoint allows a Provider to send vehicle telemetry data in a batch for any number of vehicles in the fleet.
191207

@@ -214,13 +230,15 @@ Body Params:
214230
| `invalid_data` | None of the provided data was valid. | |
215231
| `missing_param` | A required parameter is missing. | Array of missing parameters |
216232

233+
[Top][toc]
234+
217235
## Telemetry Data
218236

219237
A standard point of vehicle telemetry. References to latitude and longitude imply coordinates encoded in the [WGS 84 (EPSG:4326)](https://en.wikipedia.org/wiki/World_Geodetic_System) standard GPS or GNSS projection expressed as [Decimal Degrees](https://en.wikipedia.org/wiki/Decimal_degrees).
220238

221239
| Field | Type | Required/Optional | Field Description |
222240
| -------------- | -------------- | --------------------- | ------------------------------------------------------------ |
223-
| `device_id` | UUID | Required | ID used in [Register](#vehicle-register) |
241+
| `device_id` | UUID | Required | ID used in [Register](#vehicle---register) |
224242
| `timestamp` | [timestamp][ts] | Required | Date/time that event occurred. Based on GPS or GNSS clock |
225243
| `gps` | Object | Required | Telemetry position data |
226244
| `gps.lat` | Double | Required | Latitude of the location |
@@ -234,15 +252,34 @@ A standard point of vehicle telemetry. References to latitude and longitude impl
234252
| `charge` | Float | Required if Applicable | Percent battery charge of vehicle, expressed between 0 and 1 |
235253
| `stop_id` | UUID | Required if Applicable | Stop that the vehicle is currently located at. Only applicable for _docked_ Micromobility. See [Stops][stops] |
236254

255+
[Top][toc]
256+
237257
## Stops
238258

239-
The `/stops` endpoint allows an agency to register Stops.
259+
The `/stops` endpoint allows an agency to register city-managed Stops, or a provider to register self-managed Stops.
240260

241261
**Endpoint:** `/stops`
242262
**Method:** `POST`
243263
**[Beta feature][beta]:** Yes (as of 1.0.0)
244264
**Request Body**: An array of [Stops][stops]
245265

266+
201 Success Response:
267+
268+
_No content returned on success._
269+
270+
400 Failure Response:
271+
272+
| `error` | `error_description` | `error_details`[] |
273+
| -------------------- | ------------------------------------------------- | ------------------------------- |
274+
| `bad_param` | A validation error occurred. | Array of parameters with errors |
275+
| `missing_param` | A required parameter is missing. | Array of missing parameters |
276+
277+
409 Failure Response:
278+
279+
| `error` | `error_description` | `error_details`[] |
280+
| -------------------- | ------------------------------------------------- | ------------------------------- |
281+
| `already_registered` | A stop with `stop_id` is already registered | |
282+
246283
**Endpoint:** `/stops`
247284
**Method:** `PUT`
248285
**[Beta feature][beta]:** Yes (as of 1.0.0)
@@ -254,12 +291,35 @@ The `/stops` endpoint allows an agency to register Stops.
254291
| status | Optional |See [Stops][stops] |
255292
| num_spots_disabled | Optional |See [Stops][stops] |
256293

294+
200 Success Response:
295+
296+
_No content returned on success._
297+
298+
400 Failure Response:
299+
300+
| `error` | `error_description` | `error_details`[] |
301+
| -------------------- | ------------------------------------------------- | ------------------------------- |
302+
| `bad_param` | A validation error occurred. | Array of parameters with errors |
303+
| `missing_param` | A required parameter is missing. | Array of missing parameters |
304+
305+
404 Failure Response:
306+
307+
_No content returned if no vehicle matching `stop_id` is found._
308+
257309
**Endpoint:** `/stops/:stop_id`
258310
**Method:** `GET`
259311
**[Beta feature][beta]:** Yes (as of 1.0.0)
260-
**`data` Payload:** `{ "stops": [] }`, an array of [Stops][stops]
312+
**Payload:** `{ "stops": [] }`, an array of [Stops][stops]
313+
314+
Path Params:
315+
316+
| Param | Type | Required/Optional | Description |
317+
| ------------ | ---- | ----------------- | ------------------------------------------- |
318+
| `stop_id` | UUID | Optional | If provided, retrieve the specified stop |
319+
320+
200 Success Response:
261321

262-
In the case that a `stop_id` query parameter is specified, the `stops` array returned will only have one entry. In the case that no `stop_id` query parameter is specified, all stops will be returned.
322+
If `stop_id` is specified, `GET` will return an array with a single stop record, otherwise it will be a list of all stop records.
263323

264324
[Top][toc]
265325

@@ -269,10 +329,10 @@ In the case that a `stop_id` query parameter is specified, the `stops` array ret
269329
[hdop]: https://support.esri.com/en/other-resources/gis-dictionary/term/358112bd-b61c-4081-9679-4fca9e3eb926
270330
[propulsion-types]: /general-information.md#propulsion-types
271331
[responses]: /general-information.md#responses
272-
[stops]: /general-information#stops
332+
[stops]: /general-information.md#stops
273333
[toc]: #table-of-contents
274334
[ts]: /general-information.md#timestamps
275335
[vehicle-types]: /general-information.md#vehicle-types
276336
[vehicle-states]: /general-information.md#vehicle-states
277337
[vehicle-events]: /general-information.md#vehicle-state-events
278-
[versioning]: /general-information.md#versioning
338+
[versioning]: /general-information.md#versioning

0 commit comments

Comments
 (0)