-
Notifications
You must be signed in to change notification settings - Fork 0
/
lyft-proposal.json
699 lines (699 loc) · 23.4 KB
/
lyft-proposal.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
{
"consumes": ["application/json"],
"produces": ["application/json"],
"schemes": ["https"],
"swagger": "2.0",
"info": {
"description": "Description.",
"title": "Samsara API",
"version": "2.0.0"
},
"host": "api.samsara.com",
"paths": {
"/fleet/vehicles/stats": {
"get": {
"description":
"This endpoint allows you to both fetch historical information for a set of vehicles, as well as a feed of all new vehicle information.\n\nIf you wish to just fetch the historical data for a vehicle, you can pass in a `startTime` and `endTime` range. This will return all known states for a vehicle during a given time range. In other words, this will return all data point readings for each vehicle between the given time range, and often one data point before the `startTime` range that represents the state of the vehicle in the first time segment. As an example, if you are looking to fetch all engine states between `t=4`and `t=10`, and the engine is `OFF` between time 3-6 and `IDLE` from 6-10, then the endpoint will return both the `OFF` and `IDLE` states.\n\nIf an `endTime` is not provided, then this will provide a continuous feed of all data points. In order to follow the feed, you can follow the pagination `hasNextPage` cursor continuously. If there is not yet a `hasNextPage=true` for the feed follow, then we recommend you wait and retry in 5 seconds.",
"tags": ["Vehicles"],
"summary": "Fetch vehicle data",
"operationId": "listVehicleGaugeHistory",
"parameters": [
{
"maximum": 10000,
"minimum": 50,
"type": "integer",
"format": "int64",
"description":
"The limit for how many objects will be in the response. This will default to 250 if not explicitly provided.",
"name": "limit",
"in": "query"
},
{
"type": "string",
"description": "The cursor position to use to return results after.",
"name": "after",
"in": "query"
},
{
"type": "string",
"description": "A start time in RFC 3339 format. Defaults to now if not provided.",
"name": "startTime",
"in": "query"
},
{
"type": "string",
"description": "An end time in RFC 3339 format. Defaults to infinity if not provided.",
"name": "endTime",
"in": "query"
},
{
"type": "string",
"description": "A comma delimited list of tagIds.",
"name": "tagIds",
"in": "query"
},
{
"type": "string",
"description": "A comma delimited list of vehicleIds",
"name": "vehicleIds",
"in": "query"
},
{
"enum": [
"ignition",
"fuel-percent",
"fuel-consumption",
"oil",
"battery",
"odometer",
"running-time",
"tire-pressure",
"barometer",
"rpm"
],
"type": "string",
"description":
"Comma-separated list of diagnostics information to return. Defaults to returning fuel and odometer information. All entries will include the GPS location for the time at which the value was recorded, if available. Example: gauges=fuel,odometer",
"name": "diagnostics",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of all diagnostics data points for the specified vehicles and time range.",
"schema": {
"$ref": "#/definitions/VehicleGaugesListHistoryResponse"
}
}
}
}
},
"/fleet/vehicles/locations": {
"get": {
"description":
"This endpoint allows you to both fetch historical locations for a vehicle, as well as a feed of all new vehicle locations.\n\nIf you wish to just fetch the historical location data for a vehicle, you can pass in a `startTime` and `endTime` range. This will return all known locations for a vehicle during a given time range. In other words, this will return all known locations for each vehicle between the given time range, and often one data point before the `startTime` range. As an example, if you are looking to fetch all locations between `t=4`and `t=6`, and we get location reading at t=3, t=5, and t=6, then the endpoint will return both location datapoints for all three readings to help you interpolate for t=4.\n\nIf an `endTime` is not provided, then this will provide a continuous feed of all vehicle locations. In order to follow the feed, you can follow the pagination `hasNextPage` cursor continuously. If there is not yet a `hasNextPage=true` for the feed follow, then we recommend you wait and retry in 5 seconds.",
"tags": ["Vehicles"],
"summary": "Fetch vehicle locations",
"operationId": "listVehicleLocationsHistory",
"parameters": [
{
"maximum": 10000,
"minimum": 50,
"type": "integer",
"format": "int64",
"description":
"The limit for how many objects will be in the response. This will default to 250 if not explicitly provided.",
"name": "limit",
"in": "query"
},
{
"type": "string",
"description": "The cursor position to use to return results after.",
"name": "after",
"in": "query"
},
{
"type": "string",
"description": "A start time in RFC 3339 format. Defaults to now if not provided.",
"name": "startTime",
"in": "query"
},
{
"type": "string",
"description": "An end time in RFC 3339 format. Defaults to infinity if not provided.",
"name": "endTime",
"in": "query"
},
{
"type": "string",
"description": "A comma delimited list of tagIds.",
"name": "tagIds",
"in": "query"
},
{
"type": "string",
"description": "A comma delimited list of vehicleIds",
"name": "vehicleIds",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of all locations for the specified vehicles and time range.",
"schema": {
"$ref": "#/definitions/VehicleLocationsListResponse"
}
}
}
}
},
"/fleet/harsh-events": {
"get": {
"description": "Fetch all harsh events for the organization in a given time period.",
"tags": ["Safety"],
"summary": "Fetch all harsh events",
"operationId": "getOrgHarshEvents",
"parameters": [
{
"type": "string",
"format": "string",
"description": "Beginning of the time range, specified in RFC 3339 time.",
"name": "startTime",
"in": "query",
"required": true
},
{
"type": "string",
"format": "string",
"description": "End of the time range, specified in RFC 3339 time.",
"name": "endTime",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "Harsh events for the organization",
"schema": {
"$ref": "#/definitions/OrgHarshEventsResponse"
}
}
}
}
}
},
"definitions": {
"BatteryVoltage": {
"description": "Battery voltage reported in millivolts.",
"type": "object",
"required": ["time", "millivolts"],
"properties": {
"millivolts": {
"description": "The battery voltage level, measured in millivolts.",
"type": "number",
"format": "int64",
"example": 13500
},
"time": {
"$ref": "#/definitions/time"
}
}
},
"EngineState": {
"description": "The state of the engine at a particular point in time. State can be Running, Off, or Idle.",
"type": "object",
"required": ["time", "state"],
"properties": {
"state": {
"type": "string",
"enum": ["Running", "Off", "Idle"]
},
"time": {
"$ref": "#/definitions/time"
}
}
},
"FuelPercent": {
"description": "Fuel percent over time reported in decimal percent of available fuel.",
"type": "object",
"required": ["time", "percent"],
"properties": {
"percent": {
"description":
"The decimal percent of fuel available for this vehicle. A full gas tank will report 100 while an empty tank will be 0.",
"type": "number",
"format": "int64",
"example": 79
},
"time": {
"$ref": "#/definitions/time"
}
}
},
"SpeedEcu": {
"type": "object",
"description": "Speed of the vehicle, as read from the vehicle ECU, in RPM",
"required": ["time", "value"],
"properties": {
"percent": {
"type": "number",
"format": "int64",
"example": 1585
},
"time": {
"$ref": "#/definitions/time"
}
}
},
"LocationsWrapper": {
"allOf": [
{
"type": "object",
"properties": {
"vehicle": {
"$ref": "#/definitions/VehicleTinyResponse"
},
"speedGps": {
"description": "Speed of the vehicle, as calculated by the GPS, in miles per hour.",
"type": "number",
"format": "int64",
"example": 79
},
"time": {
"$ref": "#/definitions/time"
}
}
},
{
"$ref": "#/definitions/location"
}
]
},
"NumericalReading": {
"description": "A sensor reading value.",
"type": "object",
"required": ["id"],
"properties": {
"name": {
"description": "Name of the sensor value.",
"type": "string",
"example": "112"
},
"value": {
"description": "Value of the reading.",
"type": "string",
"example": "112"
}
}
},
"OdometerSeries": {
"description": "A listing of odometer history over time",
"type": "object",
"required": ["meters", "time"],
"properties": {
"meters": {
"description": "A combined odometer reading based on GPS and engine odometer data.",
"type": "number",
"format": "int64",
"example": 30949885
},
"time": {
"$ref": "#/definitions/time"
}
}
},
"OrgHarshEventsResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"type": "object",
"properties": {
"behaviorLabels": {
"type": "array",
"items": {
"type": "object",
"properties": {
"labelSource": {
"description": "Label source of the harsh event",
"type": "string",
"format": "string",
"example": "SYSTEM"
},
"labelType": {
"description": "Label type of the harsh event",
"type": "string",
"format": "string",
"example": "Braking"
}
}
}
},
"downloadForwardVideoUrl": {
"description": "Download forward video url",
"type": "string",
"format": "string",
"example":
"samsara-dashcam-videos::3318/222/1499411220000/huKA7IhpBV-camera-video-segment-1244214895.mp4"
},
"downloadInwardVideoUrl": {
"description": "Download inward video url",
"type": "string",
"format": "string",
"example":
"samsara-dashcam-videos::3318/222/1499411220000/huKA7IhpBV-camera-video-segment-1244214895.mp4"
},
"downloadTrackedInwardVideoUrl": {
"description": "Download tracked inward video url",
"type": "string",
"format": "string",
"example":
"samsara-dashcam-videos::3318/222/1499411220000/huKA7IhpBV-camera-video-segment-1244214895.mp4"
},
"incidentReportUrl": {
"description": "Incident report url",
"type": "string",
"format": "string",
"example":
"https://cloud.samsara.com/groups/4185/fleet/reports/safety/vehicle/222/incident/1499411220000"
},
"location": {
"type": "object",
"properties": {
"latitude": {
"description": "Longitude at which the harsh event happened",
"type": "number",
"format": "float",
"example": 37.762554666
},
"longitude": {
"description": "Longitude at which the harsh event happened",
"type": "number",
"format": "float",
"example": -122.409358166
}
}
},
"acceleration": {
"type": "object",
"properties": {
"x-axis": {
"description": "Acceleration in x axis, in g-units",
"type": "number",
"format": "float",
"example": 1.44
},
"y-axis": {
"description": "Acceleration in y axis, in g-units",
"type": "number",
"format": "float",
"example": 0.44
},
"z-axis": {
"description": "Acceleration in z axis, in g-units",
"type": "number",
"format": "float",
"example": 0.19
},
}
}
}
}
},
"pagination": {
"$ref": "#/definitions/paginationResponse"
}
}
},
"OilLife": {
"description": "Oil Life Percentage",
"type": "object",
"required": ["time", "value"],
"properties": {
"percentage": {
"type": "number",
"format": "float",
"example": 64
},
"time": {
"$ref": "#/definitions/time"
}
}
},
"AmbientAirTemp": {
"description": "Ambient air temperature of the vehicle.",
"type": "object",
"required": ["time", "value"],
"properties": {
"fahrenheit": {
"type": "number",
"format": "float",
"example": 89
},
"time": {
"$ref": "#/definitions/time"
}
}
},
"EngineCoolantTemp": {
"description": "Temperature of the engine coolant",
"type": "object",
"required": ["time", "value"],
"properties": {
"fahrenheit": {
"type": "number",
"format": "float",
"example": 136.98
},
"time": {
"$ref": "#/definitions/time"
}
}
},
"ParkingBrake": {
"description": "`true` when the parking brake is engaged; `false` when the parking brake is disengaged.",
"type": "object",
"required": ["time", "value"],
"properties": {
"time": {
"$ref": "#/definitions/time"
},
"value": {
"type": "boolean",
"example": true
}
}
},
"TirePressure": {
"description": "Tire pressure of each wheel, in PSI.",
"type": "object",
"properties": {
"front left": {
"type": "number",
"format": "float",
"example": 39
},
"front right": {
"type": "number",
"format": "float",
"example": 38
},
"rear left": {
"type": "number",
"format": "float",
"example": 39
},
"rear right": {
"type": "number",
"format": "float",
"example": 36
},
"time" :{
"$ref": "#/definitions/time"
}
}
},
"VehicleGaugeHistory": {
"type": "object",
"properties": {
"fuelPercent": {
"$ref": "#/definitions/FuelPercent"
},
"ignition": {
"$ref": "#/definitions/EngineState"
},
"odometer": {
"$ref": "#/definitions/OdometerSeries"
},
"speedECU": {
"$ref": "#/definitions/SpeedEcu"
},
"oilLife": {
"$ref": "#/definitions/OilLife"
},
"batteryVoltage": {
"$ref": "#/definitions/BatteryVoltage"
},
"engineCoolantTemp": {
"$ref": "#/definitions/EngineCoolantTemp"
},
"ambientAirTemp": {
"$ref": "#/definitions/AmbientAirTemp"
},
"parkingBrake": {
"$ref": "#/definitions/ParkingBrake"
},
"tirePressure": {
"$ref": "#/definitions/TirePressure"
}
}
},
"VehicleGaugesHistoryWrapper": {
"type": "object",
"allOf": [
{
"type": "object",
"properties": {
"vehicle": {
"$ref": "#/definitions/VehicleTinyResponse"
}
}
},
{
"$ref": "#/definitions/VehicleGaugeHistory"
}
]
},
"VehicleGaugesListHistoryResponse": {
"description": "List of vehicle stats for the specified time period.",
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/VehicleGaugesHistoryWrapper"
}
},
"pagination": {
"$ref": "#/definitions/paginationResponse"
}
}
},
"VehicleLocationsListResponse": {
"description": "List of vehicle locations for the specified time period.",
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/LocationsWrapper"
}
},
"pagination": {
"$ref": "#/definitions/paginationResponse"
}
}
},
"VehicleTinyResponse": {
"description": "A tiny vehicle response object.",
"type": "object",
"required": ["id"],
"properties": {
"id": {
"description": "Unique Samsara ID for the vehicle.",
"type": "string",
"example": "112"
},
"name": {
"description": "Name of the vehicle in the Samsara dashboard.",
"type": "string",
"example": "112"
}
}
},
"location": {
"description": "Location object",
"type": "object",
"required": ["latitude", "longitude"],
"properties": {
"addresses": {
"description":
"Array of address mini-objects, in which the given lat/long coordinates falls within the address's geofence borders. If the location is not within any geofence, then this value will not appear",
"type": "array",
"items": {
"description": "Address book entry, if one exists",
"type": "object",
"properties": {
"id": {
"description": "Address book identifier",
"type": "string",
"example": "123"
},
"name": {
"description": "Name of this address book entry",
"type": "string",
"example": "Main Distribution Warehouse"
}
}
}
},
"latitude": {
"description": "GPS latitude represented in degrees",
"type": "number",
"format": "double",
"example": 122.142
},
"longitude": {
"description": "GPS longitude represented in degrees",
"type": "number",
"format": "double",
"example": -93.343
}
}
},
"paginationResponse": {
"description": "Pagination parameters.",
"type": "object",
"properties": {
"endCursor": {
"description":
"Cursor identifier representing the last element in the response. This value should be used in conjunction with a subsequent request's 'starting_after' query parameter.",
"type": "string",
"format": "string",
"example": "cmVhyI"
},
"hasNextPage": {
"description": "True if there are more pages of results after this response.",
"type": "boolean",
"example": true
},
"nextPageURL": {
"description":
"URL for retrieving the next page of results. If present, this URL will contain the next page of results.",
"type": "string",
"format": "string",
"example": "https://api.samsara.com/fleet/vehicles/engine-gauge-history\u0026after=cmVhyI"
}
}
},
"time": {
"description": "UTC timestamp in RFC3339 milliseconds format.",
"type": "string",
"example": "2019-05-03T04:30:31.492Z"
}
},
"parameters": {
"diagnosticsParam": {
"enum": [
"ignition",
"fuel-percent",
"fuel-consumption",
"oil",
"battery",
"odometer",
"running-time",
"tire-pressure",
"barometer",
"rpm"
],
"type": "string",
"description":
"Comma-separated list of diagnostics information to return. Defaults to returning fuel and odometer information. All entries will include the GPS location for the time at which the value was recorded, if available. Example: gauges=fuel,odometer",
"name": "diagnostics",
"in": "query"
}
},
"tags": [
{
"description":
"The vehicle object describes a vehicle's attributes and settings within Samsara. A vehicle is generated in the Samsara platform when a vehicle gateway is installed. The gateway often auto-populates information such as the VIN, make, model, and year.\n\nThe vehicle object is often referenced in other objects. For these references, you will see a mini-object of the vehicle, rather than the full vehicle information. The mini-object encompasses a smaller subset of commonly-referenced field, such as the Samsara ID, name, and external ID.",
"name": "Vehicles"
},
{
"description":
"Samsara provides you with more visibility on whether or not your fleets are being safe. With the collection of safety endpoints, you can get aggregate metrics around the performance of a particular driver or vehicle, as well as detailed logs of all the harsh events that take place in an organization.",
"name": "Safety"
}
]
}