Skip to content

Commit 49a2c80

Browse files
committed
Agency root endpoints: /events /telemetry
1 parent 8aaa96c commit 49a2c80

1 file changed

Lines changed: 39 additions & 39 deletions

File tree

agency/README.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ This specification contains a collection of RESTful APIs used to specify the dig
1717
* [Vehicles](#vehicles)
1818
* [Vehicle - Register](#vehicle---register)
1919
* [Vehicle - Update](#vehicle---update)
20-
* [Vehicles - Events](#vehicles---events)
21-
* [Vehicles - Telemetry](#vehicles---telemetry)
2220
* [Trips](#trips)
21+
* [Telemetry](#telemetry)
22+
* [Events](#events)
2323
* [Stops](#stops)
2424
* [Stops - Register](#stops---register)
2525
* [Stops - Update](#stops---update)
@@ -100,17 +100,17 @@ _No content returned on vehicle not found._
100100

101101
[Top][toc]
102102

103-
## Vehicle - Register
103+
### Vehicle - Register
104104

105105
The `/vehicles` registration endpoint is used to register vehicles for use in the Agency's jurisdiction.
106106

107107
**Endpoint**: `/vehicles`
108108
**Method:** `POST`
109-
**Payload:** An array of [Vehicles](#vehicle)
109+
**Payload:** An array of [Vehicles](/data-types.md#vehicles)
110110

111111
200 Success Response:
112112

113-
See [Bulk Responses](#bulk-responses)
113+
See [Bulk Responses][bulk-responses]
114114

115115
[Top][toc]
116116

@@ -126,17 +126,17 @@ See [Bulk Responses](#bulk-responses)
126126

127127
**None**
128128

129-
## Vehicle - Update
129+
### Vehicle - Update
130130

131131
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.
132132

133133
**Endpoint**: `/vehicles`
134134
**Method:** `PUT`
135-
**Payload:** An array of [Vehicles](#vehicle)
135+
**Payload:** An array of [Vehicles](/data-types.md#vehicles)
136136

137137
200 Success Response:
138138

139-
See [Bulk Responses](#bulk-responses)
139+
See [Bulk Responses][bulk-responses]
140140

141141
### Vehicle Update Error Codes:
142142

@@ -147,39 +147,42 @@ See [Bulk Responses](#bulk-responses)
147147

148148
[Top][toc]
149149

150-
## Vehicles - Events
150+
## Trips
151151

152-
The vehicle `/events` endpoint allows the Provider to submit events describing the state changes of multiple vehicles.
152+
The Trips endpoint serves two purposes:
153+
154+
* 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.
155+
* 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.
153156

154-
**Endpoint:** `/vehicles/events`
157+
**Endpoint:** `/trips`
155158
**Method:** `POST`
156-
**Payload:** An array of [Vehicle Events](#vehicle-event)
159+
**Payload:** Array of [Trips](/data-types.md#trips)
157160

158161
200 Success Response:
159162

160-
See [Bulk Responses](#bulk-responses)
163+
See [Bulk Responses][bulk-responses]
161164

162-
### Event Errors:
165+
### Trip Errors:
163166

164-
| `error` | `error_description` | `error_details`[] |
165-
| ------- | ------------------- | ----------------- |
166-
| `bad_param` | A validation error occurred | Array of parameters with errors |
167-
| `missing_param` | A required parameter is missing | Array of missing parameters |
168-
| `unregistered` | This `device_id` is unregistered | |
167+
| `error` | `error_description` | `error_details`[] |
168+
| -------------------- | ------------------------------------------------- | ------------------------------- |
169+
| `bad_param` | A validation error occurred | Array of parameters with errors |
170+
| `missing_param` | A required parameter is missing | Array of missing parameters |
171+
| `unregistered` | This `device_id` is unregistered | |
169172

170173
[Top][toc]
171174

172-
## Vehicles - Telemetry
175+
## Telemetry
173176

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

176-
**Endpoint**: `/vehicles/telemetry`
179+
**Endpoint**: `/telemetry`
177180
**Method**: `POST`
178181
**Payload**: An array of [Vehicle Telemetry][vehicle-telemetry]
179182

180183
200 Success Response:
181184

182-
See [Bulk Responses](#bulk-responses)
185+
See [Bulk Responses][bulk-responses]
183186

184187
### Telemetry Errors:
185188

@@ -191,28 +194,25 @@ See [Bulk Responses](#bulk-responses)
191194

192195
[Top][toc]
193196

194-
## Trips
195-
196-
The Trips endpoint serves two purposes:
197+
## Events
197198

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.
199+
The vehicle `/events` endpoint allows the Provider to submit events describing the state changes of multiple vehicles.
200200

201-
**Endpoint:** `/trips`
201+
**Endpoint:** `/events`
202202
**Method:** `POST`
203-
**Payload:** Array of [Trips](#trip-data)
203+
**Payload:** An array of vehicle [Events](/data-types.md#events)
204204

205205
200 Success Response:
206206

207-
See [Bulk Responses](#bulk-responses)
207+
See [Bulk Responses][bulk-responses]
208208

209-
### Trip Errors:
209+
### Event Errors:
210210

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 | |
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 | |
216216

217217
[Top][toc]
218218

@@ -228,7 +228,7 @@ The `/stops` endpoint allows an agency to register city-managed Stops, or a prov
228228

229229
200 Success Response:
230230

231-
See [Bulk Responses](#bulk-responses)
231+
See [Bulk Responses][bulk-responses]
232232

233233
#### Stops Register Errors:
234234

@@ -258,7 +258,7 @@ See [Bulk Responses](#bulk-responses)
258258

259259
200 Success Response:
260260

261-
See [Bulk Responses](#bulk-responses)
261+
See [Bulk Responses][bulk-responses]
262262

263263
#### Stops update Errors:
264264

@@ -306,7 +306,7 @@ The `/reports` endpoint allows an agency to register aggregated report counts in
306306

307307
200 Success Response:
308308

309-
See [Bulk Responses](#bulk-responses)
309+
See [Bulk Responses][bulk-responses]
310310

311311
#### Reports Register Errors:
312312

0 commit comments

Comments
 (0)