Skip to content

Commit ab3e6b4

Browse files
committed
Update Agency response codes
1 parent 4e4b7a5 commit ab3e6b4

2 files changed

Lines changed: 115 additions & 33 deletions

File tree

agency/README.md

Lines changed: 114 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,28 @@ The `/vehicles` registration endpoint is used to register vehicles for use in th
8787
**Method:** `POST`
8888
**Payload:** An array of [Vehicles](/data-types.md#vehicles)
8989

90-
200 Success Response:
90+
#### Responses
9191

92-
See [Bulk Responses][bulk-responses]
92+
Possible Responses:
93+
201
94+
400
95+
401
96+
406
97+
409
98+
500
99+
100+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
93101

94102
[Top][toc]
95103

96-
#### Vehicle Register Error Codes:
104+
#### Error Codes:
97105

98106
| `error` | `error_description` | `error_details`[] |
99107
| -------------------- | ------------------------------------------------- | ------------------------------- |
100108
| `bad_param` | A validation error occurred | Array of parameters with errors |
101109
| `missing_param` | A required parameter is missing | Array of missing parameters |
102110
| `already_registered` | A vehicle with `device_id` is already registered | |
103111

104-
403 Unauthorized Response:
105-
106-
**None**
107-
108112
### Vehicle - Update
109113

110114
The `/vehicles` update endpoint is used to change vehicle information, should some aspect of the vehicle change, such as the `vehicle_id`. Each vehicle must already be registered.
@@ -113,16 +117,24 @@ The `/vehicles` update endpoint is used to change vehicle information, should so
113117
**Method:** `PUT`
114118
**Payload:** An array of [Vehicles](/data-types.md#vehicles)
115119

116-
200 Success Response:
120+
#### Responses
121+
122+
Possible Responses:
123+
200
124+
400
125+
401
126+
406
127+
409
128+
500
117129

118-
See [Bulk Responses][bulk-responses]
130+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
119131

120-
#### Vehicle Update Error Codes:
132+
#### Error Codes:
121133

122134
| `error` | `error_description` | `error_details`[] |
123135
| -------------------- | ------------------------------------------------- | ------------------------------- |
124136
| `bad_param` | A validation error occurred | Array of parameters with errors |
125-
| `unregistered` | This `device_id` is unregistered | |
137+
| `unregistered` | This `device_id` is unregistered | |
126138

127139
[Top][toc]
128140

@@ -140,8 +152,6 @@ _Path Parameters:_
140152
| ------------ | ---- | ----------------- | ------------------------------------------- |
141153
| `device_id` | UUID | Optional | If provided, retrieve the specified vehicle |
142154

143-
200 Success Response:
144-
145155
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:
146156

147157
```json
@@ -157,9 +167,17 @@ If `device_id` is specified, `GET` will return an array with a single vehicle re
157167
}
158168
```
159169

160-
404 Failure Response:
170+
#### Responses
161171

162-
_No content returned on vehicle not found._
172+
Possible Responses:
173+
200
174+
400 (with `vehicle_id` parameter)
175+
401
176+
404
177+
406
178+
500
179+
180+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
163181

164182
[Top][toc]
165183

@@ -177,8 +195,6 @@ _Path Parameters:_
177195
| ------------ | ---- | ----------------- | ------------------------------------------- |
178196
| `device_id` | UUID | Optional | If provided, retrieve the specified vehicle |
179197

180-
200 Success Response:
181-
182198
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:
183199

184200
```json
@@ -194,9 +210,17 @@ If `device_id` is specified, `GET` will return an array with a vehicle status re
194210
}
195211
```
196212

197-
404 Failure Response:
213+
#### Responses
198214

199-
_No content returned on vehicle not found._
215+
Possible Responses:
216+
200
217+
400 (with `vehicle_id` parameter)
218+
401
219+
404
220+
406
221+
500
222+
223+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
200224

201225
[Top][toc]
202226

@@ -211,9 +235,17 @@ The Trips endpoint serves two purposes:
211235
**Method:** `POST`
212236
**Payload:** Array of [Trips](/data-types.md#trips)
213237

214-
200 Success Response:
238+
### Responses
239+
240+
Possible Responses:
241+
201
242+
400
243+
401
244+
404
245+
406
246+
500
215247

216-
See [Bulk Responses][bulk-responses]
248+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
217249

218250
### Trip Errors:
219251

@@ -233,9 +265,17 @@ The vehicle `/telemetry` endpoint allows a Provider to send vehicle telemetry da
233265
**Method**: `POST`
234266
**Payload**: An array of vehicle [Telemetry][vehicle-telemetry]
235267

236-
200 Success Response:
268+
### Responses
269+
270+
Possible Responses:
271+
201
272+
400
273+
401
274+
404
275+
406
276+
500
237277

238-
See [Bulk Responses][bulk-responses]
278+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
239279

240280
### Telemetry Errors:
241281

@@ -255,9 +295,17 @@ The vehicle `/events` endpoint allows the Provider to submit events describing t
255295
**Method:** `POST`
256296
**Payload:** An array of vehicle [Events](/data-types.md#events)
257297

258-
200 Success Response:
298+
### Responses
259299

260-
See [Bulk Responses][bulk-responses]
300+
Possible Responses:
301+
201
302+
400
303+
401
304+
404
305+
406
306+
500
307+
308+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
261309

262310
### Event Errors:
263311

@@ -279,9 +327,17 @@ The `/stops` endpoint allows an agency to register city-managed Stops, or a prov
279327
**Method:** `POST`
280328
**Payload**: An array of [Stops][stops]
281329

282-
200 Success Response:
330+
### Responses
331+
332+
Possible Responses:
333+
201
334+
400
335+
401
336+
406
337+
409
338+
500
283339

284-
See [Bulk Responses][bulk-responses]
340+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
285341

286342
#### Stops Register Errors:
287343

@@ -315,9 +371,17 @@ See [Bulk Responses][bulk-responses]
315371
| num_places_disabled | Optional |See [Stops][stops] |
316372
| devices | Optional |See [Stops][stops] |
317373

318-
200 Success Response:
374+
### Responses
375+
376+
Possible Responses:
377+
200
378+
400
379+
401
380+
404
381+
406
382+
500
319383

320-
See [Bulk Responses][bulk-responses]
384+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
321385

322386
#### Stops update Errors:
323387

@@ -341,10 +405,19 @@ _Path Parameters:_
341405
| ------------ | ---- | ----------------- | ------------------------------------------- |
342406
| `stop_id` | UUID | Optional | If provided, retrieve the specified stop |
343407

344-
200 Success Response:
345-
346408
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.
347409

410+
### Responses
411+
412+
Possible Responses:
413+
200
414+
401
415+
404
416+
406
417+
500
418+
419+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
420+
348421
[Top][toc]
349422

350423
## Reports
@@ -363,9 +436,16 @@ The `/reports` endpoint allows an agency to register aggregated report counts in
363436
**Method:** `POST`
364437
**Payload**: A CSV of [Reports][reports]
365438

366-
200 Success Response:
439+
### Responses
440+
441+
Possible Responses:
442+
201
443+
400
444+
401
445+
406
446+
500
367447

368-
See [Bulk Responses][bulk-responses]
448+
See [Responses][responses], [Bulk Responses][bulk-responses], and [schema][schema] for details.
369449

370450
#### Reports Register Errors:
371451

@@ -390,6 +470,7 @@ See [Bulk Responses][bulk-responses]
390470
[propulsion-types]: /data-types.md#propulsion-types
391471
[reports]: /data-types.md#reports
392472
[responses]: /general-information.md#responses
473+
[schema]: /schema/
393474
[stops]: /data-types.md#stops
394475
[telemetry-data]: /data-types.md#telemetry
395476
[trip-data]: /data-types.md#trips

general-information.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ During the Beta period for this feature, location and telemetry data remain requ
174174
- **400:** Bad request.
175175
- **401:** Unauthorized: Invalid, expired, or insufficient scope of token.
176176
- **404:** Not Found: Object does not exist, returned on `GET` or `POST` operations if the object does not exist.
177+
- **406:** MDS version in Accept header is unsupported or invalid.
177178
- **409:** Conflict: `POST` operations when an object already exists and an update is not possible.
178179
- **500:** Internal server error: In this case, the answer may contain a `text/plain` body with an error message for troubleshooting.
179180

0 commit comments

Comments
 (0)