# Synthesis

The driver synthesis service provides a driver's scores and driving statistics. The data are obtained by averaging scores and aggregating trip data over the driver's entire activity, the current month, and the current week.

The driver synthesis is updated each time a new trip is analyzed.

{% hint style="info" %}
If you have your **admin API key**, you can try the API via this [**link**](https://drivequant.stoplight.io/docs/drivequant-public/00599504c6f36-get-driver-synthesis).
{% endhint %}

## Synthesis of driver's scores

<mark style="color:blue;">`GET`</mark> `https://service.drivequant.com/v3/drivekit/admin/drivers/{userId}/synthesis`

Get a synthesis of DriveQuant scores and statistics for a specified driver.

#### Path Parameters

| Name   | Type   | Description                |
| ------ | ------ | -------------------------- |
| userId | string | Driver's unique identifier |

#### Headers

| Name                   | Type   | Description   |
| ---------------------- | ------ | ------------- |
| DriveKit-Admin-API-Key | string | Admin API Key |

{% tabs %}
{% tab title="200 " %}

```javascript
{
  "userInfo": {
    "userId": "USER_ID",
    "firstname": "USER_FIRSTNAME",
    "lastname": "USER_LASTNAME",
    "companyName": "COMPANY_NAME",
    "registerDate": "2020-01-25-15-41-41",
    "firstTrip": "2020-01-28T12:36:45.000+0000",
    "lastTrip": "2020-10-10T09:42:52.999+0000"
  },
  "smartphoneData": {
    "phoneModel": "Google Pixel 3a",
    "appBuildNumber": "364",
    "osVersion": "30",
    "osType": "Android",
    "sdkVersion": "1.6.1",
    "phoneLanguage": "ENGLISH",
    "rawPhoneLanguage": "en-EN"
  },
  "scoresTimeRange": {
    "efficiency": {
      "overall": 7.96,
      "currentWeek": 7.7,
      "currentMonth": 7.97
    },
    "safety": {
      "overall": 8.28,
      "currentWeek": 7.3,
      "currentMonth": 7.71
    },
    "phoneDistraction": {
      "overall": 9.79,
      "currentWeek": 10,
      "currentMonth": 10
    },
    "speeding": {
      "overall": 1.01,
      "currentWeek": 2.17,
      "currentMonth": 2.09
    },
    "distance": {
      "overall": 6931.019999999995,
      "currentWeek": 130.74599999999998,
      "currentMonth": 194.183
    },
    "acceleration": {
      "overall": 0,
      "currentWeek": 0,
      "currentMonth": 0
    },
    "braking": {
      "overall": 0,
      "currentWeek": 0,
      "currentMonth": 0
    },
    "adherence": {
      "overall": 0,
      "currentWeek": 0,
      "currentMonth": 0
    },
    "fuelVolume": {
      "overall": 0,
      "currentWeek": 0,
      "currentMonth": 0
    },
    "co2Mass": {
      "overall": 0,
      "currentWeek": 0,
      "currentMonth": 0
    }
  },
  "scoresRoadContext": [
    {
      "roadContext": "TRAFFIC_JAM",
      "distance": 54.20400000000003,
      "duration": 3.8825000000000007,
      "efficiencyScore": 0,
      "safetyScore": 0
    },
    {
      "roadContext": "HEAVY_URBAN_TRAFFIC",
      "distance": 33.150000000000006,
      "duration": 1.7058333333333333,
      "efficiencyScore": 7.405208333333333,
      "safetyScore": 9.85
    },
    {
      "roadContext": "CITY",
      "distance": 1549.5510000000008,
      "duration": 37.7361111111111,
      "efficiencyScore": 7.527835051546392,
      "safetyScore": 8.022529644268776
    },
    {
      "roadContext": "SUBURBAN",
      "distance": 2290.7050000000004,
      "duration": 34.89499999999998,
      "efficiencyScore": 7.792338709677419,
      "safetyScore": 8.247272727272728
    },
    {
      "roadContext": "EXPRESSWAYS",
      "distance": 2978.6750000000006,
      "duration": 27.01527777777778,
      "efficiencyScore": 9.058461538461538,
      "safetyScore": 8.745161290322581
    }
  ],
  "customerData": {}
}
```

{% endtab %}

{% tab title="401 " %}

```
Unauthorized
```

{% endtab %}

{% tab title="404 " %}

```
User Not Found
```

{% endtab %}
{% endtabs %}

## Response

The table below summarizes the list of synthesis data.

<table><thead><tr><th width="203.33333333333331">Field </th><th width="186">Type</th><th>Description</th></tr></thead><tbody><tr><td>userInfo</td><td><a href="#user-info">UserInfo</a></td><td>User information</td></tr><tr><td>smartphoneData</td><td><a href="#smartphone-data">SmartphoneData</a></td><td>Information about the user's smartphone</td></tr><tr><td>customerData</td><td><a href="#customer-data">CustomerData</a></td><td>Specific customer-related data</td></tr><tr><td>scoresTimeRange</td><td><a href="#scorestimerange">ScoresTimeRange</a></td><td>Average driving scores per period</td></tr><tr><td>scoresRoadContext</td><td><a href="#scoresroadcontext">ScoresRoadContext</a></td><td>Driving statistics and average scores per road context</td></tr></tbody></table>

### User info

<table><thead><tr><th width="167">Field</th><th width="98.66666666666666">Type</th><th>Description</th></tr></thead><tbody><tr><td>userId</td><td><code>string</code></td><td>User unique identifier</td></tr><tr><td>firstname</td><td><code>string</code></td><td>User first name</td></tr><tr><td>lastname</td><td><code>string</code></td><td>User last name</td></tr><tr><td>companyName</td><td><code>string</code></td><td>Company name</td></tr><tr><td>registerDate</td><td><code>date</code></td><td>User registration date<br><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></td></tr><tr><td>firstTrip</td><td><code>date</code></td><td>Date of the first trip<br><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></td></tr><tr><td>lastTrip</td><td><code>date</code></td><td>Date of the last trip<br><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></td></tr><tr><td>lastUpdate</td><td><code>date</code></td><td>Date of the last synthesis data update.<br><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></td></tr></tbody></table>

### Smartphone data

<table><thead><tr><th width="210.66666666666666">Field</th><th width="142">Type</th><th>Description</th></tr></thead><tbody><tr><td>phoneModel</td><td><code>string</code></td><td>Device model name</td></tr><tr><td>appBuildNumber</td><td><code>string</code></td><td>Application build number</td></tr><tr><td>osVersion</td><td><code>string</code></td><td>Version of the operating system</td></tr><tr><td>osType</td><td><code>string</code></td><td>Platform: iOS or Android</td></tr><tr><td>sdkVersion</td><td><code>string</code></td><td>Version of the DriveKit SDK</td></tr><tr><td>phoneLanguage</td><td><code>string</code></td><td>Phone language</td></tr><tr><td>rawPhoneLanguage</td><td><code>string</code></td><td>Raw phone language</td></tr></tbody></table>

### Customer data

Customer data consists of customer-specific metadata such as: license plate number, commercial email opt-in, contract number (formatted as a map of key-value).

### ScoresTimeRange

For each theme (efficiency, safety, phoneDistraction, speeding, distance, acceleration, braking, adherence, fuelVolume, co2Mass):

<table><thead><tr><th width="165">Field</th><th width="111.66666666666666">Type</th><th>Description</th></tr></thead><tbody><tr><td>overall</td><td><code>double</code></td><td>Average score based on all trips</td></tr><tr><td>currentWeek</td><td><code>double</code></td><td>Average score based on trips performed during the current week</td></tr><tr><td>currentMonth</td><td><code>double</code></td><td>Average score based on trips performed during the current month</td></tr></tbody></table>

### ScoresRoadContext

<table><thead><tr><th width="178.66666666666666">Field</th><th width="143">Type</th><th>Description</th></tr></thead><tbody><tr><td>roadContext</td><td><code>string</code></td><td>Road context (see below)</td></tr><tr><td>distance</td><td><code>double</code></td><td>Total driving distance (in km)</td></tr><tr><td>duration</td><td><code>double</code></td><td>Total driving duration (in min)</td></tr><tr><td>efficiencyScore</td><td><code>double</code></td><td>Average ecodriving score</td></tr><tr><td>safetyScore</td><td><code>double</code></td><td>Average safety score</td></tr></tbody></table>

### Road context <a href="#driving-context" id="driving-context"></a>

Driving contexts are calculated from **the GPS velocity**. They are not based on map data.

<table><thead><tr><th width="241">Value</th><th>Description</th></tr></thead><tbody><tr><td><code>HEAVY_URBAN_TRAFFIC</code></td><td>Speed below 30 km/h and distance between two stops greater than 100m</td></tr><tr><td><code>CITY</code></td><td>30 km/h &#x3C; Speed &#x3C; 65 km/h</td></tr><tr><td><code>SUBURBAN</code></td><td>65 km/h &#x3C; Speed &#x3C; 96 km/h</td></tr><tr><td><code>EXPRESSWAYS</code></td><td>Speed > 96 km/h</td></tr></tbody></table>
