Calculate driving behavior

/v2/ecodriving/calculate

This endpoint returns driving behavior information according to the provided filter.

Note about the alarms:
When this endpoint is used with a token obtained using a APIv2 user, all alarms types are considered.
If the token is obtained by a human user, then the alarms types are restricted to those available to the user in question.

Parameters

A filter object, in JSON format, that defines the parameters for the calculation.


{
    "from": "2023-10-12T13:39:14.968Z",
    "to": "2023-10-13T13:39:14.968Z",
    "groupBy": 1,
    "isDetailed": true,
    "vehicles": [ 0 ],
    "drivers": [ 0 ],
    "ecoProfiles": [ 0 ],
    "manufacturers": [ 0 ],
    "models": [ 0 ],
    "engines": [ 0 ],
    "canbusOnly": true,
    "lowMileage": true
}


FieldDescription
from The timestamp of the begining of the interval.
If this field is not specified, the endpoint will consider it as being 24 hours before the to timestamp.
no UTC Now - 24h
to The timestamp of the end of the interval.
If this field this fied is not specified, then the current date/time is considered.
no UTC Now
groupBy Defines how the calculation is grouped. Available groupping options are:

IDGroup Name
0Vehicle
1Driver

enum yes
isDetailed Specifies the level of detail of the data to be returned
if true is specified, then all ecodriving records are returned;
if not specified or false is specified, the returned records are aggregated by vehicle or driver, according with the specified in the groupBy option. bool no
vehicles Array of IDs of the vehicles to include in the calculation.
If the field if not specified, null or empty, then all the vehicles in the account are considered. int[] no
drivers Array of IDs of the drivers to include in the calculation.
If the field if not specified, null or empty, then all the drivers in the account are considered. int[] no
ecoProfiles Array of IDs of the Eco profiles to include in the calculation.
If the field if not specified, null or empty, then all the profiles are considered.
Check the endpoint Get profiles to see how to get the list of eco profiles. int[] no
manufacturers Array of IDs of the manufacturers to include in the calculation.
If the field if not specified, null or empty, then all the manufacturers are considered.
Check the endpoint Get manufacturers to see how to get the list of the manufacturers. int[] no
models Array of IDs of the models to include in the calculation.
If the field if not specified, null or empty, then all the models are considered.
Check the endpoint Get models to see how to get the list of the models. int[] no
engines Array of IDs of the engines to include in the calculation.
If the field if not specified, null or empty, then all the engines are considered.
Check the endpoint Get engines to see how to get the list of the engines. int[] no
canbusOnly Specifies if only the vehicles with CANBus should be considered. bool no false
lowMileage Specifies if the vehicles or drivers - depending on the option specified in groupBy - with low mileage in the period should be included in the results.
false: All vehicles/drivers are included in the results
true: Only vehicles with a minimum mileage are included in the results.
The value of the minimum mileage is defined for the company in Frontend, in ADMINISTRATION > ACCOUNT > DRIVING BEHAVIOR > Minimum Mileage.
If this value is not explicitly defined, then the value of 20Km will be considered. bool no false

Return

The expected return of the endpoint when the request is valid is a JSON object with the folowing format:

[
      {
         "Recommendations": [0],
         "HasLowMileage": true,
         "HasTripsWithEco": true,
         "VehicleId": 0,
         "LicensePlate": "string",
         "Drivers": ["string"]
         "DriverId": 0,
         "DriverName": "string",
         "DriverUsername": "string",
         "Vehicles": ["string"],
         "EcoProfileId": int,
         "VehiclesId": [0],
         "DriversId": : [0],
         "Score": 0.0,
         "ScoreCustomized": 0.0,
         "Mileage": 0.0,  
         "DrivingTime": 0,  
         "AverageConsumption": 0.0,  
         "MileageGps": 0.0,  
         "MileageCanbus": 0.0,  
         "TotalConsumption": 0.0,  
         "AverageSpeed": 0.0,
         "IdleTimePerc": 0.0,
         "HighRPMPerc": 0.0,
         "IdlingConsumption": 0.0,
         "BrakeStrokes": 0.0,
         "IdlingConsumption": 0.0,
         "LowSpeedAccelerationScore": 0,
         "HighSpeedAccelerationScore": 0,
         "LowSpeedBrakingScore": 0,
         "HighSpeedBrakingScore": 0,
         "IdlingScore": 0,
         "NoCruiseControlScore": 0,
         "HighRPMScore": 0,
         "AlarmsScore": 0,
         "FastAccelerationBrakeShiftScore": 0,
         "HarshCorneringScore": 0,
         "AccelerationWithCCActiveScore": 0,
         "LowSpeedAccelerationOccurrences": 0.0,
         "HighSpeedAccelerationOccurrences": 0.0,
         "LowSpeedBrakingOccurrences": 0.0,
         "HighSpeedBrakingOccurrences": 0.0,
         "IdlingOccurrences": 0.0,
         "NoCruiseControlOccurrences": 0.0,
         "HighRPMOccurrences": 0.0,
         "SpeedingOccurrences": 0.0,
         "AlarmOccurrences": 0.0,
         "FastAccelerationBrakeShiftOccurrences": 0.0,
         "HarshCorneringOccurrences": 0.0,
         "AccelerationWithCCActiveOccurrences": 0.0,
         "HighRPMOccurrencesAbsolute": 0.0,
         "NoCruiseControlOccurrencesAbsolute": 0.0,
         "LowSpeedBrakingOccurrencesAbsolute": 0.0,
         "LowSpeedAccelerationOccurrencesAbsolute": 0.0,
         "HighSpeedAccelerationOccurrencesAbsolute": 0.0,
         "AlarmOccurrencesAbsolute": 0.0,
         "FastAccelerationBrakeShiftOccurrencesAbsolute": 0.0,
         "HarshCorneringOccurrencesAbsolute": 0.0,
         "AccelerationWithCCActiveOccurrencesAbsolute": 0.0,
         "IdlingOccurrencesCustomized": 0.0,
         "HighRPMOccurrencesCustomized": 0.0,
         "NoCruiseControlOccurrencesCustomized": 0.0,
         "LowSpeedBrakingOccurrencesCustomized": 0.0,
         "HighSpeedBrakingOccurrencesCustomized": 0.0,
         "LowSpeedAccelerationOccurrencesCustomized": 0.0,
         "HighSpeedAccelerationOccurrencesCustomized": 0.0,
         "AlarmOccurrencesCustomized": 0.0,
         "FastAccelerationBrakeShiftOccurrencesCustomized": 0.0,
         "HarshCorneringOccurrencesCustomized": 0.0,
         "AccelerationWithCCActiveOccurrencesCustomized": 0.0,
         "DrivingBehaviorCanbusPerformanceData": object
      }
  ]

FieldDescription
recommendations Array of IDs of the recomentations determined by the calcutation.
Check the endpoint Get recommendations to see how to get the list of the recomendations. int[]
hasLowMileage HasLowMileage bool
hasTripsWithEco Has trips with eco bool
vehicleId The ID of the vehicle in Frotcom int
licensePlate The license plate of the vehicle string
drivers Drivers names array string[]
driverId Driver id int
driverName Driver name string
driverUsername Driver username string
vehicles Vehicles license plates string[]
ecoProfileId The IF of the profile of the vehicle.
Check the endpoint Get profiles to see how to get the list of eco profiles. int
vehiclesId Vehicles ids array int[]
driversId Drivers ids array int[]
score Score double
scoreCustomized Customized score double
mileage Mileage double
drivingTime The driving time, in seconds. int
averageConsumption Average consumption double nullable
mileageGps The mileage traveled by the vehicle calculated using the GPS positions. double
mileageCanbus The mileage traveled by the vehilce considering the data read from CAN Bus double nullable
totalConsumption Total consumption double
averageSpeed Average speed double
idleTimePerc Idle time perc double
highRPMPerc High RPM perc double nullable
idlingConsumption Idling consumption double
brakeStrokes Brake strokes double
idlingConsumption Idling consumption double
lowSpeedAccelerationScore Low speed acceleration score int
highSpeedAccelerationScore High speed acceleration score int
lowSpeedBrakingScore Low speed braking score int
highSpeedBrakingScore High speed braking score int
idlingScore Idling score int
noCruiseControlScore Score related with the usage of the crise control. int
highRPMScore High RPM score int
alarmsScore Alarms score int
fastAccelerationBrakeShiftScore Fast acceleration brake shift score int
harshCorneringScore Harsh cornering score int
accelerationWithCCActiveScore Acceleration with Cruise Control active score int
lowSpeedAccelerationOccurrences Low speed acceleration occurrences double
highSpeedAccelerationOccurrences High speed acceleration occurrences double
lowSpeedBrakingOccurrences Low speed braking occurrences double
highSpeedBrakingOccurrences High speed braking occurrences double
idlingOccurrences Idling occurrences double
noCruiseControlOccurrences Percentage of double
highRPMOccurrences High RPM occurrences double
speedingOccurrences Speeding occurrences double
alarmOccurrences Alarm occurrences double
fastAccelerationBrakeShiftOccurrences Fast acceleration brake shift occurrences double
harshCorneringOccurrences Harsh cornering occurrences double
accelerationWithCCActiveOccurrences Acceleration with Cruise Control active occurrences double
highRPMOccurrencesAbsolute The time, in seconds, that the vehicle was in high RPM. double
noCruiseControlOccurrencesAbsolute Racio of how many minutes per hour the cruise control was NOT active. double
lowSpeedBrakingOccurrencesAbsolute Low speed braking occurrences absolute double
lowSpeedAccelerationOccurrencesAbsolute Low speed acceleration occurrences absolute double
highSpeedAccelerationOccurrencesAbsolute High speed acceleration occurrences absolute double
alarmOccurrencesAbsolute Alarm occurrences absolute double
fastAccelerationBrakeShiftOccurrencesAbsolute Fast acceleration brake shift occurrences absolute double
harshCorneringOccurrencesAbsolute Harsh cornering occurrences absolute double
accelerationWithCCActiveOccurrencesAbsolute The number of times the driver pressed the accelerator pedal while the cruise control was active. double
idlingOccurrencesCustomized Idling occurrences customized double
highRPMOccurrencesCustomized High RPM occurrences customized double
noCruiseControlOccurrencesCustomized The customized weight of the usage of the Cruise Control in the driving behavior. double
lowSpeedBrakingOccurrencesCustomized The customized weight of the low speed braking occurrences in driver customized score.
double
highSpeedBrakingOccurrencesCustomized The customized weight of the high speed braking occurrences in driver customized score.
double
lowSpeedAccelerationOccurrencesCustomized The customized weight of the low speed acceleration occurrences in driver customized score.
double
highSpeedAccelerationOccurrencesCustomized The customized weight of the high speed acceleration occurrences in driver customized score.
double
alarmOccurrencesCustomized The customized weight of the alarm occurrences in driver customized score. double
fastAccelerationBrakeShiftOccurrencesCustomized Fast acceleration brake shift occurrences customized double
harshCorneringOccurrencesCustomized Harsh cornering occurrences customized double
accelerationWithCCActiveOccurrencesCustomized Acceleration with Cruise Control active occurrences customized double
drivingBehaviorCanbusPerformanceData Object in JSON format containing the driving behavior canbus performance data. DrivingBehaviorCanbusPerformanceData

Response HTTP Codes

200 - OK

  • The endpoint executed sucessfully.

204 - No content

  • No data was found.

400 - Bad Request

  • The user does not have these permissions: ADMIN_CNPD_COMPLIANCE and ADMIN_OVERRIDE_CNPD
  • The user has these permissions: ADMIN_CNPD_COMPLIANCE and ADMIN_OVERRIDE_CNPD and the from field from filter was more than 7 days ago
  • The user is not allowed to view vehicle history
  • The search filter matches an interval greater than 31 days

401 - Unauthorized

  • The authentication token is invalid

403 - Forbidden

  • User does not have permission to view driving behavior dashboard