Skip to content

Commit 63f4c0d

Browse files
committed
Updated Provider response codes
1 parent a11f22b commit 63f4c0d

2 files changed

Lines changed: 105 additions & 14 deletions

File tree

agency/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ MDS is intended to be used for multiple transportation modes, including its orig
5959

6060
### Responses and Error Messages
6161

62+
The response to a client request must include a valid HTTP status code defined in the [IANA HTTP Status Code Registry][iana].
63+
64+
The response must set the `Content-Type` header as specified in the [Versioning section][versioning].
65+
66+
Response bodies must be a `UTF-8` encoded JSON object
67+
6268
See the [Responses][responses], [Error Messages][error-messages], and [Bulk Responses][bulk-responses] sections, and the [schema][schema] for more details.
6369

6470
[Top][toc]
@@ -171,7 +177,7 @@ If `device_id` is specified, `GET` will return an array with a single vehicle re
171177

172178
Possible HTTP Status Codes:
173179
200
174-
400 (with `vehicle_id` parameter)
180+
400 (with parameter)
175181
401
176182
404
177183
406
@@ -214,7 +220,7 @@ If `device_id` is specified, `GET` will return an array with a vehicle status re
214220

215221
Possible HTTP Status Codes:
216222
200
217-
400 (with `vehicle_id` parameter)
223+
400 (with parameter)
218224
401
219225
404
220226
406
@@ -466,6 +472,7 @@ See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schem
466472
[geography-driven-events]: /general-information.md#geography-driven-events
467473
[error-messages]: /general-information.md#error-messages
468474
[hdop]: https://en.wikipedia.org/wiki/Dilution_of_precision_(navigation)
475+
[iana]: https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
469476
[modes]: /modes/README.md
470477
[propulsion-types]: /data-types.md#propulsion-types
471478
[reports]: /data-types.md#reports

provider/README.md

Lines changed: 96 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ General authorization details are specified in the [Authorization section](/gene
5454

5555
### Versioning
5656

57-
`provider` APIs must handle requests for specific versions of the specification from clients.
57+
`Provider` APIs must handle requests for specific versions of the specification from clients.
5858

5959
Versioning must be implemented as specified in the [Versioning section][versioning].
6060

@@ -70,11 +70,13 @@ MDS is intended to be used for multiple transportation modes, including its orig
7070

7171
The response to a client request must include a valid HTTP status code defined in the [IANA HTTP Status Code Registry][iana].
7272

73-
See [Responses][responses] for information on valid MDS response codes and [Error Messages][error-messages] for information on formatting error messages.
74-
7573
The response must set the `Content-Type` header as specified in the [Versioning section][versioning].
7674

77-
Response bodies must be a `UTF-8` encoded JSON object and must minimally include the MDS `version` and a `data` payload:
75+
Response bodies must be a `UTF-8` encoded JSON object
76+
77+
See the [Responses][responses], [Error Messages][error-messages], and [Bulk Responses][bulk-responses] sections, and the [schema][schema] for more details.
78+
79+
Response bodies must be a `UTF-8` encoded JSON object and must minimally include the MDS `version` and an object payload:
7880

7981
```json
8082
{
@@ -195,8 +197,6 @@ _Path Parameters:_
195197
| ------------ | ---- | ----------------- | ------------------------------------------- |
196198
| `device_id` | UUID | Optional | If provided, retrieve the specified vehicle |
197199

198-
200 Success Response:
199-
200200
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:
201201

202202
```json
@@ -212,9 +212,17 @@ If `device_id` is specified, `GET` will return an array with a single vehicle re
212212
}
213213
```
214214

215-
404 Failure Response:
215+
#### Responses
216216

217-
_No content returned on vehicle not found._
217+
Possible HTTP Status Codes:
218+
200
219+
400 (with parameter)
220+
401
221+
404
222+
406
223+
500
224+
225+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
218226

219227
[Top][toc]
220228

@@ -234,8 +242,6 @@ _Path Parameters:_
234242
| ------------ | ---- | ----------------- | ------------------------------------------- |
235243
| `device_id` | UUID | Optional | If provided, retrieve the specified vehicle |
236244

237-
200 Success Response:
238-
239245
If `device_id` is specified, `GET` will return an array with a vehicle status record, otherwise it will be a list of vehicle records with pagination details per the [JSON API](https://jsonapi.org/format/#fetching-pagination) spec:
240246

241247
```json
@@ -251,9 +257,17 @@ If `device_id` is specified, `GET` will return an array with a vehicle status re
251257
}
252258
```
253259

254-
404 Failure Response:
260+
#### Responses
261+
262+
Possible HTTP Status Codes:
263+
200
264+
400 (with parameter)
265+
401
266+
404
267+
406
268+
500
255269

256-
_No content returned on vehicle not found._
270+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
257271

258272
[Top][toc]
259273

@@ -308,6 +322,19 @@ processing for that hour:
308322

309323
For the near-ish real time use cases, please use the [events][events] endpoint.
310324

325+
#### Responses
326+
327+
Possible HTTP Status Codes:
328+
200
329+
202
330+
400 (with parameter)
331+
401
332+
404
333+
406
334+
500
335+
336+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
337+
311338
[Top][toc]
312339

313340
## Telemetry
@@ -333,6 +360,17 @@ Telemetry for a [trip](#trip) must include at least 2 points: the start point an
333360

334361
Without a `telemetry_time` query parameter, `/telemetry` shall return a `400 Bad Request` error.
335362

363+
#### Responses
364+
365+
Possible HTTP Status Codes:
366+
200
367+
400 (with parameter)
368+
401
369+
406
370+
500
371+
372+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
373+
336374
[Top][toc]
337375

338376
## Events
@@ -384,6 +422,19 @@ processing for that hour:
384422
}
385423
```
386424

425+
#### Responses
426+
427+
Possible HTTP Status Codes:
428+
200
429+
202
430+
400 (with parameter)
431+
401
432+
404
433+
406
434+
500
435+
436+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
437+
387438
[Top][toc]
388439

389440
### Recent Events
@@ -411,6 +462,17 @@ Should either side of the requested time range be missing, `/events/recent` shal
411462

412463
Should either side of the requested time range be greater than 2 weeks before the time of the request, `/events/recent` shall return a `400 Bad Request` error.
413464

465+
#### Responses
466+
467+
Possible HTTP Status Codes:
468+
200
469+
400 (with parameter)
470+
401
471+
406
472+
500
473+
474+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
475+
414476
[Top][toc]
415477

416478
## Stops
@@ -436,6 +498,18 @@ In addition to the standard [Provider payload wrapper](#response-format), respon
436498

437499
In the case that a `stop_id` path 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.
438500

501+
#### Responses
502+
503+
Possible HTTP Status Codes:
504+
200
505+
400 (with parameter)
506+
401
507+
404 (with parameter)
508+
406
509+
500
510+
511+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
512+
439513
[Top][toc]
440514

441515
## Reports
@@ -456,6 +530,16 @@ The authenticated reports are monthly, historic flat files that may be pre-gener
456530
**`data` Filename:** monthly file named by year and month, e.g. `/reports/YYYY-MM.csv`
457531
**`data` Payload:** monthly CSV files of [Report](/data-types.md#Reports) objects
458532

533+
#### Responses
534+
535+
Possible HTTP Status Codes:
536+
200
537+
401
538+
404
539+
500
540+
541+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
542+
459543
[Top][toc]
460544

461545
### Reports - Example

0 commit comments

Comments
 (0)