You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: provider/README.md
+50-12Lines changed: 50 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -185,14 +185,33 @@ The `/trips` API should allow querying trips with the following query parameters
185
185
| --------------- | ------ | --------------- |
186
186
|`end_time`|`YYYY-MM-DDTHH`, an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended datetime representing an UTC hour between 00 and 23. | All trips with an end time occurring within the hour. For example, requesting `end_time=2019-10-01T07` returns all trips where `2019-10-01T07:00:00 <= trip.end_time < 2019-10-01T08:00:00` UTC. |
187
187
188
-
If the provider was operational during the requested hour the provider shall return
189
-
a 200 response, even if there are no trips to report (in which case
190
-
the response will contain an empty list of trips).
191
-
If the requested hour occurs in a time period in which the provider was not operational
192
-
or the hour is not yet in the past `/trips` shall return a `404 Not Found` error.
193
-
194
188
Without an `end_time` query parameter, `/trips` shall return a `400 Bad Request` error.
195
189
190
+
### Trips - Responses
191
+
192
+
The API's response will depend on the hour queried and the status of data
193
+
processing for that hour:
194
+
195
+
* For hours that are not yet in the past the API shall return a `404 Not Found`
196
+
response.
197
+
* For hours in which the provider was not operating the API shall return a
198
+
`404 Not Found` response.
199
+
* For hours that are in the past but for which data is not yet available
200
+
the API shall return a `102 Processing` response.
201
+
* For all other hours the API shall return a `200 OK` response with a fully
202
+
populated body, even for hours that contain no trips to report.
203
+
If the hour has no trips to report the response shall contain an empty
204
+
array of trips:
205
+
206
+
```json
207
+
{
208
+
"version": "x.y.z",
209
+
"data": {
210
+
"trips": []
211
+
}
212
+
}
213
+
```
214
+
196
215
For the near-ish real time use cases, please use the [events][events] endpoint.
197
216
198
217
[Top][toc]
@@ -287,14 +306,33 @@ The `/status_changes` API should allow querying status changes with the followin
287
306
| --------------- | ------ | --------------- |
288
307
|`event_time`|`YYYY-MM-DDTHH`, an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) extended datetime representing an UTC hour between 00 and 23. | All status changes with an event time occurring within the hour. For example, requesting `event_time=2019-10-01T07` returns all status changes where `2019-10-01T07:00:00 <= status_change.event_time < 2019-10-01T08:00:00` UTC. |
289
308
290
-
If the provider was operational during the requested hour the provider shall return
291
-
a 200 response, even if there are no status changes to report (in which case
292
-
the response will contain an empty list of status changes).
293
-
If the requested hour occurs in a time period in which the provider was not operational
294
-
or the hour is not yet in the past `/status_changes` shall return a `404 Not Found` error.
295
-
296
309
Without an `event_time` query parameter, `/status_changes` shall return a `400 Bad Request` error.
297
310
311
+
### Status Changes - Responses
312
+
313
+
The API's response will depend on the hour queried and the status of data
314
+
processing for that hour:
315
+
316
+
* For hours that are not yet in the past the API shall return a `404 Not Found`
317
+
response.
318
+
* For hours in which the provider was not operating the API shall return a
319
+
`404 Not Found` response.
320
+
* For hours that are in the past but for which data is not yet available
321
+
the API shall return a `102 Processing` response.
322
+
* For all other hours the API shall return a `200 OK` response with a fully
323
+
populated body, even for hours that contain no status changes to report.
324
+
If the hour has no status changes to report the response shall contain an
0 commit comments