Skip to content

Commit 7084307

Browse files
committed
Table of content and order fixes
1 parent a9ae3a8 commit 7084307

2 files changed

Lines changed: 74 additions & 61 deletions

File tree

agency/README.md

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,21 @@ This specification contains a collection of RESTful APIs used to specify the dig
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)
2528

2629
## General information
2730

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

109112
See [Bulk Responses](#bulk-responses)
110113

114+
[Top][toc]
115+
111116
### Vehicle Register Error Codes:
112117

113118
| `error` | `error_description` | `error_details`[] |
@@ -185,6 +190,31 @@ See [Bulk Responses](#bulk-responses)
185190

186191
[Top][toc]
187192

193+
## Trips
194+
195+
The Trips endpoint serves two purposes:
196+
197+
* 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.
198+
* 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.
199+
200+
**Endpoint:** `/trips`
201+
**Method:** `POST`
202+
**Payload:** Array of [Trips](#trip-data)
203+
204+
200 Success Response:
205+
206+
See [Bulk Responses](#bulk-responses)
207+
208+
### Trip Errors:
209+
210+
| `error` | `error_description` | `error_details`[] |
211+
| -------------------- | ------------------------------------------------- | ------------------------------- |
212+
| `bad_param` | A validation error occurred | Array of parameters with errors |
213+
| `missing_param` | A required parameter is missing | Array of missing parameters |
214+
| `unregistered` | This `device_id` is unregistered | |
215+
216+
[Top][toc]
217+
188218
## Stops
189219

190220
### Stops - Register
@@ -209,6 +239,8 @@ See [Bulk Responses](#bulk-responses)
209239

210240
403 Unauthorized Response:
211241

242+
**None**
243+
212244
[Top][toc]
213245

214246
### Stops - Update
@@ -235,6 +267,8 @@ See [Bulk Responses](#bulk-responses)
235267
| `missing_param` | A required parameter is missing | Array of missing parameters |
236268
| `unregistered` | No stop with `stop_id` is already registered | |
237269

270+
[Top][toc]
271+
238272
### Stops - Readback
239273

240274
**Endpoint:** `/stops/:stop_id`
@@ -251,32 +285,6 @@ Path Params:
251285

252286
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.
253287

254-
[Top][toc]
255-
256-
## Trips
257-
258-
The Trips endpoint serves two purposes:
259-
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.
262-
263-
**Endpoint:** `/trips`
264-
**Method:** `POST`
265-
**Payload:** Array of [Trips](#trip-data)
266-
267-
200 Success Response:
268-
269-
See [Bulk Responses](#bulk-responses)
270-
271-
### Trip Errors:
272-
273-
| `error` | `error_description` | `error_details`[] |
274-
| -------------------- | ------------------------------------------------- | ------------------------------- |
275-
| `bad_param` | A validation error occurred | Array of parameters with errors |
276-
| `missing_param` | A required parameter is missing | Array of missing parameters |
277-
| `unregistered` | This `device_id` is unregistered | |
278-
279-
280288
[Top][toc]
281289

282290
[accessibility-options]: /general-information.md#accessibility-options

provider/README.md

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,23 @@ This specification contains a data standard for *mobility as a service* provider
1717
* [JSON Schema](#json-schema)
1818
* [Pagination](#pagination)
1919
* [Municipality Boundary](#municipality-boundary)
20-
* [Event Times](#event-times)
2120
* [Other Data Types](#other-data-types)
22-
* [Trips][trips]
21+
* [Vehicles][vehicles]
22+
* [Trips][#trips]
2323
* [Trips - Query Parameters](#trips---query-parameters)
2424
* [Trips - Responses](#trips---responses)
2525
* [Routes](#routes)
2626
* [Telemetry][telemetry]
2727
* [Telemetry - Query Parameters](#telemetry---query-parameters)
2828
* [Events][events]
29-
* [Historical Events - Query Parameters](#events---query-parameters)
29+
* [Historical Events - Query Parameters](#historical-events---query-parameters)
3030
* [Historical Events - Responses](#historical-events---responses)
3131
* [Recent Events](#recent-events)
3232
* [Recent Events - Query Parameters](#recent-events---query-parameters)
33-
* [Vehicles][vehicles]
3433
* [Stops](#stops)
3534
* [Reports](#reports)
3635
* [Reports - Response](#reports---response)
3736
* [Reports - Example](#reports---example)
38-
* [Data Redaction](#data-redaction)
39-
4037

4138
## General Information
4239

@@ -52,6 +49,8 @@ This specification uses data types including timestamps, UUIDs, and vehicle stat
5249

5350
Versioning must be implemented as specified in the [Versioning section][versioning].
5451

52+
[Top][toc]
53+
5554
### Modes
5655

5756
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.
@@ -160,6 +159,33 @@ For Timestamps, Vehicle Types, Propulsion Types, UUIDs, Costs, and Currencies, r
160159

161160
[Top][toc]
162161

162+
## Vehicles
163+
164+
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.
165+
166+
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.
167+
168+
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]:
169+
170+
```json
171+
{
172+
"version": "x.y.z",
173+
"data": {
174+
"vehicles": []
175+
},
176+
"last_updated": "12345",
177+
"ttl": "12345"
178+
}
179+
```
180+
181+
**Endpoint:** `/vehicles`
182+
**Method:** `GET`
183+
**[Beta feature][beta]:** No (as of 1.2.0)
184+
**Schema:** [`vehicles` schema][vehicles-schema]
185+
**`data` Payload:** `{ "vehicles": [] }`, an array of [Vehicle](vehicle) objects
186+
187+
[Top][toc]
188+
163189
## Trips
164190

165191
A [trip][trips-general-info] represents a journey taken by a *mobility as a service* customer with
@@ -186,6 +212,8 @@ The `/trips` API should allow querying trips with the following query parameters
186212

187213
Without an `end_time` query parameter, `/trips` shall return a `400 Bad Request` error.
188214

215+
[Top][toc]
216+
189217
### Trips - Responses
190218

191219
The API's response will depend on the hour queried and the status of data
@@ -274,6 +302,8 @@ Unless stated otherwise by the municipality, this endpoint must return only thos
274302
**Schema:** [`telemetry` schema][telemetry-schema]
275303
**`data` Payload:** `{ "telemetry": [] }`, an array of `telemetry` objects
276304

305+
[Top][toc]
306+
277307
### Telemetry - Query Parameters
278308

279309
| Parameter | Format | Expected Output |
@@ -364,33 +394,6 @@ Should either side of the requested time range be greater than 2 weeks before th
364394

365395
[Top][toc]
366396

367-
## Vehicles
368-
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.
370-
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.
372-
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]:
374-
375-
```json
376-
{
377-
"version": "x.y.z",
378-
"data": {
379-
"vehicles": []
380-
},
381-
"last_updated": "12345",
382-
"ttl": "12345"
383-
}
384-
```
385-
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
391-
392-
[Top][toc]
393-
394397
## Stops
395398

396399
Stop information should be updated on a near-realtime basis by providers who operate _docked_ mobility devices in a given municipality.
@@ -424,6 +427,8 @@ Reports are information that providers can send back to agencies containing aggr
424427

425428
The authenticated reports are monthly, historic flat files that may be pre-generated by the provider.
426429

430+
[Top][toc]
431+
427432
### Reports - Response
428433

429434
**Endpoint:** `/reports`

0 commit comments

Comments
 (0)