Push Data

Introduction

The transfer of data collected by the SDK as well as driving indicators to a client server is a common need for users of the DriveQuant platform.
The information provided can be used for additional data processing, for archiving in databases or to display information on websites.
This is why DriveQuant offers the possibility to retrieve all the driving data collected by the mobile SDKs as well as all the driving indicators that result from our analyses. This is the purpose of the Push Data service.

Principle

The Push Data service sends the trip results after it is completed and analyzed. The process is described below.
    When the trip recording's started (manually or automatically), DriveQuant's mobile SDK saves GPS data locally on the user's phone.
    When the driver has finished his trip, the SDK automatically stops recording and requests the trip analysis service hosted on the DriveQuant's platform.
    At the end of the processing, which takes about 2 seconds, the results are returned to the SDK and can be displayed in the driver's mobile application.
    The data push service is scheduled every minute. Therefore, the maximum delay between the end of the trip analysis and the push to your server is 1 minute.

Configuration

Trip data are sent as a POST request to a client URL. The URL must be provided to DriveQuant in order to set up and activate the push data service.
The body of the request is a JSON object with a set of fields that contain the driving scores organized by categories and the raw data collected on the user smartphone stored in tables. An example of data in JSON format is given at the end of this section.
It is mandatory to configure a response code. If the post is accepted, we expect a status code of 200 (OK). In case of failure, for any answer other than 200, the service will attempt to post the data again. The retry strategy is described below.
If the service returns a 200 HTTP code while the data has not been accepted by the client server, then, there will be no further attempt to send the data.

Security

The trip results may include driver’s private information (location, username, email). For this reason, the two following security measures are mandatory:
    The URL provided must be HTTPS.
    You must set up a BasicAuth header on every request. To do so, you can send us the credentials that need to be added to each request.
Optionally, we can provide IP addresses from which requests are performed in case you need to secure your endpoint with IP whitelisting.

Automatic Retry

DriveQuant will retry to push the trip data in case of a HTTP error. In order to avoid too many consecutive retries, the push data replay will be performed one time per day from the day after a fail, this until the trip has been accepted.

Sample Message

The data included in a message posted by the push data service can be configured. The data available in this stream depends on the analytics services you subscribe to.
For security and user privacy reasons, we may delete or hash sensitive data.
The example below gives an exhaustive overview of the data resulting from DriveQuant's trip analysis. Definition of all these variables can be found in the related section.
The Push Data API specification can be downloaded here in OpenAPI YAML format.
1
2
{
3
"itinId": "6030ebe4ea60426b34e9b3bf",
4
"firstname": "Fistname",
5
"lastname": "Lastname",
6
"itineraryStatistics": {
7
"tripDuration": 1996.0,
8
"drivingDuration": 1737.0,
9
"idlingDuration": 259.0,
10
"drivingPercentage": 87.0,
11
"idlingPercentage": 13.0,
12
"distance": 15801.0,
13
"speedMean": 30.5,
14
"subdispNb": 60,
15
"meteo": 2,
16
"day": true,
17
"weekDay": false,
18
"transportationMode": 1
19
},
20
"ecoDriving": {
21
"score": 7.1,
22
"scoreAccel": -1.7,
23
"scoreMain": 0.9,
24
"scoreDecel": -0.5,
25
"stdDevAccel": 2.2006383,
26
"stdDevMain": 0.99105114,
27
"stdDevDecel": 3.797757,
28
"energyClass": 2
29
},
30
"fuelEstimation": {
31
"co2Mass": 2.691,
32
"co2Emission": 170.0,
33
"fuelVolume": 1.153,
34
"fuelConsumption": 7.3,
35
"idleFuelVolume": 0.049,
36
"idleFuelPercentage": 4.28,
37
"idleFuelConsumption": 0.696,
38
"idleCo2Emission": 1.625,
39
"idleCo2Mass": 0.115,
40
"engineTempStatus": true,
41
"coldFuelVolume": 0.018
42
},
43
"safety": {
44
"safetyScore": 9.1,
45
"nbAdh": 2,
46
"nbAccel": 0,
47
"nbDecel": 3,
48
"nbAdhCrit": 0,
49
"nbAccelCrit": 0,
50
"nbDecelCrit": 1
51
},
52
"advancedEcoDriving": {
53
"ecoDrivingContext": [
54
{
55
"contextId": 0,
56
"distance": 6.9,
57
"duration": 19.1,
58
"efficiencyScore": 11.0,
59
"scoreAccel": 6.0,
60
"scoreMain": 6.0,
61
"scoreDecel": 6.0
62
},
63
{
64
"contextId": 1,
65
"distance": 3.7,
66
"duration": 6.5,
67
"efficiencyScore": 6.1,
68
"scoreAccel": -2.8,
69
"scoreMain": 0.3,
70
"scoreDecel": 1.3
71
},
72
{
73
"contextId": 2,
74
"distance": 64.8,
75
"duration": 61.8,
76
"efficiencyScore": 6.7,
77
"scoreAccel": -1.7,
78
"scoreMain": 0.6,
79
"scoreDecel": -1.3
80
},
81
{
82
"contextId": 3,
83
"distance": 12.7,
84
"duration": 7.8,
85
"efficiencyScore": 6.6,
86
"scoreAccel": -1.8,
87
"scoreMain": 1.6,
88
"scoreDecel": 0.8
89
},
90
{
91
"contextId": 4,
92
"distance": 11.8,
93
"duration": 4.9,
94
"efficiencyScore": 8.4,
95
"scoreAccel": -1.1,
96
"scoreMain": 0.1,
97
"scoreDecel": -2.9
98
}
99
]
100
},
101
"advancedFuelEstimation": {
102
"fuelEstimationContext": [
103
{
104
"contextId": 0,
105
"distance": 6.9,
106
"duration": 19.1,
107
"co2Mass": 0.199,
108
"co2Emission": 179.0,
109
"fuelVolume": 0.085,
110
"fuelConsumption": 7.69
111
},
112
{
113
"contextId": 1,
114
"distance": 3.7,
115
"duration": 6.5,
116
"co2Mass": 0.099,
117
"co2Emission": 167.0,
118
"fuelVolume": 0.042,
119
"fuelConsumption": 7.139
120
},
121
{
122
"contextId": 2,
123
"distance": 64.8,
124
"duration": 61.8,
125
"co2Mass": 1.832,
126
"co2Emission": 176.0,
127
"fuelVolume": 0.785,
128
"fuelConsumption": 7.535
129
},
130
{
131
"contextId": 3,
132
"distance": 12.7,
133
"duration": 7.8,
134
"co2Mass": 0.264,
135
"co2Emission": 130.0,
136
"fuelVolume": 0.113,
137
"fuelConsumption": 5.549
138
},
139
{
140
"contextId": 4,
141
"distance": 11.8,
142
"duration": 4.9,
143
"co2Mass": 0.182,
144
"co2Emission": 96.0,
145
"fuelVolume": 0.078,
146
"fuelConsumption": 4.107
147
}
148
]
149
},
150
"advancedSafety": {
151
"safetyContext": [
152
{
153
"contextId": 0,
154
"distance": 6.9,
155
"duration": 19.1,
156
"nbAdh": 0,
157
"nbAccel": 0,
158
"nbDecel": 0,
159
"nbAdhCrit": 0,
160
"nbAccelCrit": 0,
161
"nbDecelCrit": 0,
162
"safetyScore": 11.0
163
},
164
{
165
"contextId": 1,
166
"distance": 3.7,
167
"duration": 6.5,
168
"nbAdh": 0,
169
"nbAccel": 0,
170
"nbDecel": 0,
171
"nbAdhCrit": 0,
172
"nbAccelCrit": 0,
173
"nbDecelCrit": 0,
174
"safetyScore": 11.0
175
},
176
{
177
"contextId": 2,
178
"distance": 64.8,
179
"duration": 61.8,
180
"nbAdh": 2,
181
"nbAccel": 0,
182
"nbDecel": 2,
183
"nbAdhCrit": 0,
184
"nbAccelCrit": 0,
185
"nbDecelCrit": 1,
186
"safetyScore": 9.1
187
},
188
{
189
"contextId": 3,
190
"distance": 12.7,
191
"duration": 7.8,
192
"nbAdh": 0,
193
"nbAccel": 0,
194
"nbDecel": 0,
195
"nbAdhCrit": 0,
196
"nbAccelCrit": 0,
197
"nbDecelCrit": 0,
198
"safetyScore": 10.0
199
},
200
{
201
"contextId": 4,
202
"distance": 11.8,
203
"duration": 4.9,
204
"nbAdh": 0,
205
"nbAccel": 0,
206
"nbDecel": 1,
207
"nbAdhCrit": 0,
208
"nbAccelCrit": 0,
209
"nbDecelCrit": 0,
210
"safetyScore": 8.0
211
}
212
]
213
},
214
"pollutants": {
215
"co": 436.34,
216
"hc": 105.19,
217
"nox": 43.45,
218
"soot": 0.01
219
},
220
"tireWear": {
221
"frontTireWear": 625151,
222
"rearTireWear": 194424,
223
"frontTireDistance": 6522,
224
"rearTireDistance": 6522,
225
"frontTireAutonomy": 25010,
226
"rearTireAutonomy": 159958,
227
"frontTireTotalWear": 20.6847961834131,
228
"rearTireTotalWear": 3.917838643900801,
229
"frontTireWearRate": 3.1593584519985076,
230
"rearTireWearRate": 0.5879650354629268
231
},
232
"brakeWear": {
233
"frontBrakePadWear": 652316,
234
"rearBrakePadWear": 490585,
235
"frontBrakeDistance": 6522,
236
"rearBrakeDistance": 6522,
237
"frontBrakeAutonomy": 51081,
238
"rearBrakeAutonomy": 70712,
239
"frontBrakeTotalWear": 11.322879923360654,
240
"rearBrakeTotalWear": 8.444911708095175,
241
"frontBrakeWearRate": 1.6040543118399773,
242
"rearBrakeWearRate": 1.1953688298028098
243
},
244
"safetyEvents": [
245
{
246
"time": 198.0,
247
"longitude": 2.2345499992370605,
248
"latitude": 48.865421295166016,
249
"velocity": 27.597404310389447,
250
"heading": 181.3752105740906,
251
"elevation": 21.428831625626,
252
"distance": 1803.0,
253
"type": 3,
254
"level": 1,
255
"value": -1.9984114049011923
256
},
257
{
258
"time": 886.0,
259
"longitude": 2.228440046310425,
260
"latitude": 48.829158782958984,
261
"velocity": 9.322159013829488,
262
"heading": 115.71003406053404,
263
"elevation": 35.0165024497636,
264
"distance": 5811.0,
265
"type": 1,
266
"level": 1,
267
"value": 0.2091391662960067
268
},
269
{
270
"time": 1179.0,
271
"longitude": 2.2220299243927,
272
"latitude": 48.776981353759766,
273
"velocity": 59.56077714321047,
274
"heading": 196.14873235105892,
275
"elevation": 169.4896656907427,
276
"distance": 8721.0,
277
"type": 3,
278
"level": 1,
279
"value": -1.851640380003413
280
},
281
{
282
"time": 1352.0,
283
"longitude": 2.2241098880767822,
284
"latitude": 48.76197814941406,
285
"velocity": 23.478607191677995,
286
"heading": 231.66262821151452,
287
"elevation": 96.56055945085538,
288
"distance": 11036.0,
289
"type": 1,
290
"level": 1,
291
"value": 0.2596086644093922
292
},
293
{
294
"time": 1352.0,
295
"longitude": 2.2241098880767822,
296
"latitude": 48.76197814941406,
297
"velocity": 23.478607191677995,
298
"heading": 231.66262821151452,
299
"elevation": 96.56055945085538,
300
"distance": 11036.0,
301
"type": 3,
302
"level": 2,
303
"value": -3.1478373502646355
304
},
305
{
306
"time": 1902.0,
307
"longitude": 2.2364699840545654,
308
"latitude": 48.742130279541016,
309
"velocity": 29.11161620369841,
310
"heading": 127.70357513427746,
311
"elevation": 76.72611043725985,
312
"distance": 14436.0,
313
"type": 3,
314
"level": 1,
315
"value": -2.095731316728654
316
}
317
],
318
"endDate": "2021-02-20T10:56:37.188+0000",
319
"itineraryData": {
320
"endDate": "2021-02-20T10:56:37.188+0000",
321
"startDate": "2021-02-20T10:23:22.188+0000",
322
"departureCity": "Puteaux",
323
"arrivalCity": "Verrières-le-Buisson",
324
"departureAddress": "Pont de Puteaux, 92800 Puteaux",
325
"arrivalAddress": "3 Rue Rimbaud, 91370 Verrières-le-Buisson"
326
},
327
"tripAdviceData": {
328
"id": "5da5b749e3f4d636f1f3376e",
329
"title": "Conseil de sécurité",
330
"message": "<br>Soit par surprise ou à cause d'un <b>dépassement de votre vitesse</b>, vous avez freiné fort à plusieurs reprises. En respectant bien les <b>distances de sécurité</b>, vous freinerez naturellement beaucoup plus progressivement et éviterez ainsi tous risques de collisions.<br>",
331
"theme": 0,
332
"adviceEvaluation": null
333
},
334
"tripAdvicesData": [
335
{
336
"id": "5da5b749e3f4d636f1f3376e",
337
"title": "Conseil de sécurité",
338
"message": "<br>Soit par surprise ou à cause d'un <b>dépassement de votre vitesse</b>, vous avez freiné fort à plusieurs reprises. En respectant bien les <b>distances de sécurité</b>, vous freinerez naturellement beaucoup plus progressivement et éviterez ainsi tous risques de collisions.<br>",
339
"messageId": "sfty-urban-day-dry-D030-brk-v01",
340
"theme": "SAFETY"
341
},
342
{
343
"id": "5da5b8c3e3f4d6370219ab7d",
344
"title": "Conseil d'éco-conduite",
345
"message": "Vous pouvez progresser.<br>Accélérez plus franchement pour atteindre rapidement votre vitesse de croisière.<br>Pour les véhicules équipés d’une boîte de vitesses manuelle, il faut passer le rapport supérieur dès que l’aiguille du compte tours atteint 1500 tours/minute pour un véhicule Diesel et aux alentours de 2000 tours/minute pour un véhicule à essence.",
346
"messageId": "eco-urban000-accW-v01",
347
"theme": "ECODRIVING"
348
}
349
],
350
"driverDistraction": {
351
"nbUnlock": 1,
352
"durationUnlock": 97.0,
353
"durationPercentUnlock": 4.86002640172576,
354
"distanceUnlock": 403.68833585416337,
355
"distancePercentUnlock": 2.5548277694713204,
356
"score": 1.9159997325752993,
357
"scoreUnlock": 6.7627283707197705,
358
"scoreCall": 1.9159997325752993,
359
"calls": [
360
{
361
"id": 0,
362
"start": 544.0035407543182,
363
"end": 634.0030286312103,
364
"durationS": 89,
365
"duration": 5,
366
"distanceM": 456,
367
"distance": 3,
368
"status": "OUTGOING",
369
"audioSystem": "SPEAKER",
370
"forbidden": true
371
}
372
]
373
},
374
"distractionEvents": [
375
{
376
"time": 539.0,
377
"latitude": 48.85495,
378
"longitude": 2.22616,
379
"velocity": 12.168000411987304,
380
"heading": -1.616703658463509,
381
"elevation": 23.05337370577991,
382
"distance": 3245.3746307904125,
383
"type": 1,
384
"duration": 97,
385
"index": 539
386
},
387
{
388
"time": 636.0,
389
"latitude": 48.85034,
390
"longitude": 2.22683,
391
"velocity": 45.22616824022174,
392
"heading": -1.3488582653419061,
393
"elevation": 29.8860134067469,
394
"distance": 3746.5653789286157,
395
"type": 2,
396
"duration": 1360,
397
"index": 636
398
}
399
],
400
"callEvents": [
401
{
402
"time": 544.0035407543182,
403
"latitude": 48.85475,
404
"longitude": 2.22616,
405
"velocity": 12.456000137329102,
406
"heading": -1.5768984084633124,
407
"elevation": 23.53374615925395,
408
"distance": 0.0,
409
"type": 3,
410
"duration": 1,
411
"index": 544,
412
"audioSystem": "SPEAKER",
413
"callType": "OUTGOING",
414
"forbidden": true
415
},
416
{
417
"time": 634.0030286312103,
418
"latitude": 48.85059,
419
"longitude": 2.22674,
420
"velocity": 46.44316055270816,
421
"heading": -1.3482454261409265,
422
"elevation": 30.170426377189013,
423
"distance": 456.0,
424
"type": 4,
425
"duration": 89,
426
"index": 634,
427
"audioSystem": "SPEAKER",
428
"callType": "OUTGOING",
429
"forbidden": true
430
}
431
],
432
"speedingEvents": [
433
{
434
"longitude": 2.240690719770278,
435
"latitude": 48.87119316290749,
436
"time": 96.0,
437
"type": 1,
438
"index": 36
439
},
440
{
441
"longitude": 2.2389993413999454,
442
"latitude": 48.87022711541927,
443
"time": 106.0,
444
"type": 0,
445
"index": 39
446
},
447
{
448
"longitude": 2.226948759849819,
449
"latitude": 48.8285248546614,
450
"time": 899.0,
451
"type": 1,
452
"index": 220
453
},
454
{
455
"longitude": 2.2247798257606703,
456
"latitude": 48.82771252373621,
457
"time": 910.0,
458
"type": 0,
459
"index": 229
460
},
461
{
462
"longitude": 2.220820796904408,
463
"latitude": 48.790306020720436,
464
"time": 1121.87393116951,
465
"type": 1,
466
"index": 374
467
},
468
{
469
"longitude": 2.222806342988146,
470
"latitude": 48.781090574187054,
471
"time": 1158.87393116951,
472
"type": 0,
473
"index": 409
474
},
475
{
476
"longitude": 2.221726988867627,
477
"latitude": 48.776698917142845,
478
"time": 1181.87393116951,
479
"type": 1,
480
"index": 428
481
},
482
{
483
"longitude": 2.221415682498137,
484
"latitude": 48.77728241347195,
485
"time": 1198.87393116951,
486
"type": 0,
487
"index": 449
488
},
489
{
490
"longitude": 2.2259807317602576,
491
"latitude": 48.77630605611952,
492
"time": 1222.87393116951,
493
"type": 1,
494
"index": 472
495
},
496
{
497
"longitude": 2.229023362169593,
498
"latitude": 48.77273423930304,
499
"time": 1252.87393116951,
500
"type": 0,
501
"index": 499
502
},
503
{
504
"longitude": 2.2291619672238197,
505
"latitude": 48.77164365290039,
506
"time": 1259.87393116951,
507
"type": 1,
508
"index": 502
509
},
510
{
511
"longitude": 2.229596580809962,
512
"latitude": 48.76831710988511,
513
"time": 1281.87393116951,
514
"type": 0,
515
"index": 525
516
}
517
],
518
"speedingStatistics": {
519
"distance": 15857,
520
"duration": 1727,
521
"speedingDistance": 1956,
522
"speedingDuration": 105,
523
"score": 4.82,
524
"speedLimitContexts": [
525
{
526
"speedLimit": 30,
527
"distance": 966,
528
"duration": 138,
529
"speedingDistance": 188,
530
"speedingDuration": 16,
531
"score": 1.09
532
},
533
{
534
"speedLimit": 50,
535
"distance": 11115,
536
"duration": 1367,
537
"speedingDistance": 1112,
538
"speedingDuration": 65,
539
"score": 3.0
540
},
541
{
542
"speedLimit": 70,
543
"distance": 1504,
544
"duration": 95,
545
"speedingDistance": 0,
546
"speedingDuration": 0,
547
"score": 10.0
548
},
549
{
550
"speedLimit": 80,
551
"distance": 655,
552
"duration": 62,
553
"speedingDistance": 0,
554
"speedingDuration": 0,
555
"score": 10.0
556
},
557
{
558
"speedLimit": 90,
559
"distance": 1617,
560
"duration": 65,
561
"speedingDistance": 656,
562
"speedingDuration": 24,
563
"score": 0.0
564
}
565
]
566
},
567
"vehicle": {
568
"typeIndex": 2,
569
"engineIndex": 1,
570
"power": 95.0,
571
"mass": 1270.0,
572
"engineDisplacement": 1368.0,
573
"gearboxIndex": 3,
574
"consumption": 6.4,
575
"autoGearboxNumber": 0.0,
576
"vehicleId": "dq_5d448140a7b11b00070db354",
577
"brand": "Fiat",
578
"model": "Tipo 2",
579
"version": "II 1.4 95 5P",
580
"year": 2016,
581
"declaredCarConsumption": -1.0,
582
"carPassengers": 1,
583
"dqIndex": "FiTi2016FT1P0095N005",
584
"frontTyreSize": "195/65/15",
585
"rearTyreSize": "195/65/15",
586
"length": 4.36,
587
"width": 1.79,
588
"height": 1.49,
589
"engineCylinderNb": 4,
590
"driveWheels": 0,
591
"extraData": {
592
"declaredYear": "2014",
593
"declaredConsumption": "6,8"
594
},
595
"statistics": {
596
"distance": 17125.132999999994,
597
"analyzedDistance": 6522.418999999997,
598
"estimatedYearDistance": 5879.961500000001
599
}
600
},
601
"username": "[email protected]",
602
"sampledRoute": {
603
"time": [
604
0.0,
605
2.0,
606
3.0,
607
//...
608
1994.87393116951,
609
1995.87393116951
610
],
611
"latitude": [
612
48.87772619263164,
613
48.877613119537884,
614
48.877562954154385,
615
// ...
616
48.73911801732323,
617
48.739126730485275
618
],
619
"longitude": [
620
2.2432564571520714,
621
2.243406746064082,
622
2.243463827807432,