# References (iOS)

## DKVehicle

<table><thead><tr><th width="229.33333333333331">Field</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>vehicleId</td><td>String</td><td>Unique identifier of the vehicle</td></tr><tr><td>name</td><td>String?</td><td><p>Name of the vehicle</p><p><em>Default value: “”</em></p></td></tr><tr><td>brand</td><td>String?</td><td><p>Vehicle brand</p><p><em>Default value: “”</em></p></td></tr><tr><td>model</td><td>String?</td><td><p>Vehicle model</p><p><em>Default value: “”</em></p></td></tr><tr><td>version</td><td>String?</td><td><p>Model version</p><p><em>Default value: “”</em></p></td></tr><tr><td>year</td><td>String?</td><td><p>Year version of the vehicle</p><p><em>Default value: “”</em></p></td></tr><tr><td>typeIndex</td><td>Int</td><td><p>Vehicle body type:</p><p>   1: Compact </p><p>   2: Sedan</p><p>   3: Luxury vehicle</p><p>   4: Estate car</p><p>   5: Minivan</p><p>   6: 4x4, SUV</p><p>   7: Sports car</p><p>   8: Convertible</p><p>   9: Commercial vehicle</p><p><em>Default value : -1</em></p></td></tr><tr><td>engineIndex</td><td>Int</td><td><p>Engine type:</p><p>   1: Gasoline</p><p>   2: Diesel</p><p>   3: Electric vehicle</p><p>   4: Gasoline-electric hybrid</p><p>   5: Diesel-electric hybrid</p><p><em>Default value : -1</em></p></td></tr><tr><td>power</td><td>Double</td><td><p>Vehicle power [ hp ]. This value must be entered in horsepower. In case you only have the engine power in kW you can apply the following formula:</p><p>P [ hp ] = P [ kW ] / 0.7355</p><p>Min: 40 hp</p><p>Max: 450 hp</p><p><em>Default value : -1</em></p></td></tr><tr><td>mass</td><td>Double</td><td><p>Vehicle mass [ kg ]</p><p>Min: 700 kg</p><p>Max: 3500 kg</p><p><em>Default value : -1</em></p></td></tr><tr><td>engineDisplacement</td><td>Double</td><td><p>Engine displacement in liter</p><p><em>Default value : -1</em></p></td></tr><tr><td>gearboxIndex</td><td>Int</td><td><p>Gearbox type:</p><p>   1: automatic</p><p>   2: manual 5-speed</p><p>   3: manual 6-speed</p><p>   4: manual 7-speed</p><p>   5: manual 8-speed</p><p><em>Default value : -1</em></p></td></tr><tr><td>autoGearboxNumber</td><td>Int</td><td><p>Number of gear ratios for the automatic gearbox. This parameter is taken into account only if <code>carGearboxIndex</code> is set to 1.</p><p><em>Default value : -1</em></p></td></tr><tr><td>consumption</td><td>Double</td><td><p>Combined fuel consumption [l/100km] measured during the New European Driving Cycle (NEDC).</p><p>Min: 3 l/100km</p><p>Max: 20 l/100km</p><p><em>Default value : -1</em></p></td></tr><tr><td>frontTireSize</td><td>String?</td><td><p>Front tire size</p><p><em>Default value : “”</em></p></td></tr><tr><td>rearTireSize</td><td>String?</td><td><p>Rear tire size</p><p><em>Default value : “”</em></p></td></tr><tr><td>length</td><td>Double</td><td><p>Vehicle’s length in meter</p><p><em>Default value : -1</em></p></td></tr><tr><td>width</td><td>Double</td><td><p>Vehicle’s width in meter</p><p><em>Default value : -1</em></p></td></tr><tr><td>height</td><td>Double</td><td><p>Vehicle’s height in meter</p><p><em>Default value : -1</em></p></td></tr><tr><td>driveWheels</td><td>Int</td><td><p>0 : front-wheel drive</p><p>1 : rear-wheel drive</p><p>2 : four-wheel drive</p><p><em>Default value : -1</em></p></td></tr><tr><td>engineCylinderNb</td><td>Int</td><td><p>Number of cylinders</p><p><em>Default value : -1</em></p></td></tr><tr><td>dqIndex</td><td>String?</td><td><p>DriveQuant vehicle index reference</p><p><em>Default value: “”</em></p></td></tr><tr><td>detectionMode</td><td><a href="#dkdetectionmode">DKDetectionMode</a>?</td><td><p>Detection mode for the vehicle.</p><p><em>Default value: .disabled</em></p></td></tr><tr><td>liteConfig</td><td>Boolean</td><td>Only for advanced configuration. This parameter is usually set to false.</td></tr><tr><td>ptac</td><td>Double?</td><td><p>Total permissible laden weight in kg of the vehicle if its a truck.</p><p><em>Default value : -1</em></p></td></tr><tr><td>extraData</td><td>[String: String]</td><td>Only for advanced configuration. Map intended for adding some additional information for the vehicle.</td></tr><tr><td>beacon</td><td><a href="#dkbeacon">DKBeacon</a>?</td><td><p>Beacon paired to the vehicle.</p><p><em>Default value : nil</em></p></td></tr><tr><td>bluetooth</td><td><a href="#dkbluetooth">DKBluetooth</a>?</td><td><p>Bluetooth device paired to the vehicle.</p><p><em>Default value : nil</em></p></td></tr><tr><td>odometer</td><td><a href="#dkvehicleodometer">DKVehicleOdometer</a>?</td><td><p>Odometer of the vehicle.</p><p><em>Default value : nil</em></p></td></tr><tr><td>odometerHistories</td><td>[<a href="#dkvehicleodometerhistory">DKVehicleOdometerHistory</a>]?</td><td><p>Odometer historical values for the vehicle.</p><p><em>Default value : nil</em></p></td></tr></tbody></table>

{% hint style="info" %}
If your vehicle has a characteristic value to `-1`, DriveQuant servers will use default values to analyze your trip.
{% endhint %}

## DKVehicleCharacteristics

See [DKVehicle](#dkvehicle) for corresponding fields

### DKCarVehicleCharacteristics

| Value | Type                     | Description                |
| ----- | ------------------------ | -------------------------- |
| base  | DKVehicleCharacteristics | Characteristics of the car |

### DKTruckVehicleCharacteristics

<table><thead><tr><th width="167.33333333333331">Value</th><th width="231">Type</th><th>Description</th></tr></thead><tbody><tr><td>base</td><td>DKVehicleCharacteristics</td><td>Characteristics of the truck</td></tr><tr><td>ptac</td><td>Double</td><td>Total permissible laden weight in kg of the truck</td></tr></tbody></table>

### TypeIndex

<table><thead><tr><th width="133">typeIndex</th><th width="92">isCar</th><th width="108">isTruck</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>✅</td><td>❌</td><td>MICRO</td></tr><tr><td>1</td><td>✅</td><td>❌</td><td>COMPACT</td></tr><tr><td>2</td><td>✅</td><td>❌</td><td>SEDAN</td></tr><tr><td>6</td><td>✅</td><td>❌</td><td>SUV</td></tr><tr><td>5</td><td>✅</td><td>❌</td><td>MINIVAN</td></tr><tr><td>9</td><td>✅</td><td>❌</td><td>COMMERCIAL</td></tr><tr><td>3</td><td>✅</td><td>❌</td><td>LUXURY</td></tr><tr><td>7</td><td>✅</td><td>❌</td><td>SPORT</td></tr><tr><td>200</td><td>❌</td><td>✅</td><td>TWO_AXLES_STRAIGHT_TRUCK</td></tr><tr><td>201</td><td>❌</td><td>✅</td><td>THREE_AXLES_STRAIGHT_TRUCK</td></tr><tr><td>202</td><td>❌</td><td>✅</td><td>FOUR_AXLES_STRAIGHT_TRUCK</td></tr><tr><td>203</td><td>❌</td><td>✅</td><td>TWO_AXLES_TRACTOR</td></tr><tr><td>204</td><td>❌</td><td>✅</td><td>THREE_AXLES_TRACTOR</td></tr><tr><td>205</td><td>❌</td><td>✅</td><td>FOUR_AXLES_TRACTOR</td></tr></tbody></table>

### DKDetectionMode

<table><thead><tr><th width="226">Value</th><th>Description</th></tr></thead><tbody><tr><td>disabled</td><td><p>The vehicle is disabled. It means that no trip can be assigned to this vehicle.</p><p>If it is the unique vehicle of the account, autostart will be disabled.</p></td></tr><tr><td>gps</td><td><p>Each trip will be assigned by default to this vehicle.</p><p>If the account has other vehicles with <code>beacon</code> or <code>bluetooth</code> detection modes, every trip where these peripherals are not seen will be assigned to this vehicle.</p></td></tr><tr><td>beacon</td><td><p>If the vehicle has this detection mode and a configured beacon, every trip where the beacon is seen will be assigned to this vehicle.</p><p>If there is no other vehicle with <code>gps</code> mode, trips will be canceled if the Beacon is not seen during a trip.</p></td></tr><tr><td>bluetooth</td><td><p>If the vehicle has this detection mode and a configured Bluetooth device, every trip where the peripheral is seen will be assigned to this vehicle.</p><p>If there is no other vehicle with <code>gps</code> mode, trips will be canceled if the Bluetooth device is not seen during a trip.</p></td></tr></tbody></table>

### DKBeacon

<table><thead><tr><th width="204.33333333333331">Field</th><th width="164">Type</th><th>Description</th></tr></thead><tbody><tr><td>proximityUuid</td><td>String</td><td>UUID of the beacon</td></tr><tr><td>major</td><td>Int</td><td>Major code</td></tr><tr><td>minor</td><td>Int</td><td>Minor code</td></tr><tr><td>uniqueId</td><td>String?</td><td>Unique code that identifies the beacon in our DriveQuant database.</td></tr></tbody></table>

### DKBluetooth

<table><thead><tr><th>Field</th><th width="200.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>macAddress</td><td>String</td><td>Peripheral MAC address</td></tr><tr><td>name</td><td>String</td><td>Bluetooth device name</td></tr></tbody></table>

### DKVehicleSyncStatus

<table><thead><tr><th width="286">Value</th><th>Description</th></tr></thead><tbody><tr><td>noError</td><td>Synchronization request has been successfully executed. List of vehicles (if they exist) are available in vehicles. </td></tr><tr><td>cacheDataOnly</td><td>Method has been called with the <code>SynchronizationType</code> parameter to <code>cache</code> so the list of vehicles stored in the local database request has been successfully executed. List of vehicles (if they exist) are returned in vehicles.</td></tr><tr><td>failedToSyncVehiclesCacheOnly</td><td>Synchronization request has failed, for example if the user has no network. List of vehicles stored in the local database (if they exist) are returned in vehicles. </td></tr><tr><td>syncAlreadyInProgress</td><td>Synchronization request is already called, so the list of vehicles stored in the local database request has been successfully executed. List of vehicles (if they exist) are returned in vehicles.</td></tr></tbody></table>

### DKVehicleReplaceStatus

| Value          | Description                                                                                  |
| -------------- | -------------------------------------------------------------------------------------------- |
| success        | Vehicle is successfully replaced and changes are saved in the local database.                |
| invalidVehicle | Error thrown when the provided vehicleId is incorrect and/or if characteristics are invalid. |
| error          | An error occurred when trying to replace the vehicle. (e.g: device has no network)           |

### DKDetectionModeStatus

<table><thead><tr><th width="274">Value</th><th>Description</th></tr></thead><tbody><tr><td>success</td><td>The detection mode of the specified vehicle has been successfully updated. The new detection mode is automatically saved in the local database.</td></tr><tr><td>error</td><td>An error occurred when trying to update the detection mode of the vehicle.</td></tr><tr><td>gpsModeAlreadyExists</td><td><p>The detection mode of the specified vehicle could not have been updated to <em>GPS</em> because the account already has a vehicle with that detection mode.</p><p>If you still want to do that, you must set <code>forceGPSVehicleUpdate</code> parameter to true.</p></td></tr></tbody></table>

## DKVehicleBluetoothStatus

<table><thead><tr><th width="228">Value</th><th>Description</th></tr></thead><tbody><tr><td>success</td><td>The Bluetooth device has been successfully paired to the specified vehicle. The vehicle data in the local database is automatically updated.</td></tr><tr><td>error</td><td>An error occurred when trying to pair the Bluetooth device to the vehicle</td></tr><tr><td>unknownVehicle</td><td>An error occurred: the specified vehicle does not belong to you.</td></tr><tr><td>unavailableBluetooth</td><td>The provided Bluetooth device is currently paired to another vehicle. You must unpair the device to that vehicle before in order to pair it to your desired vehicle.</td></tr></tbody></table>

### DKVehicleBluetoothRemoveStatus

<table><thead><tr><th width="208">Value</th><th>Description</th></tr></thead><tbody><tr><td>success</td><td>The Bluetooth device has been successfully unpaired to the specified vehicle. The vehicle data in the local database is automatically updated.</td></tr><tr><td>error</td><td>An error occurred when trying to unpair the Bluetooth device to the vehicle</td></tr><tr><td>unknownVehicle</td><td>An error occurred: the specified vehicle does not belong to the user.</td></tr></tbody></table>

### DKOdometerSyncStatus

<table><thead><tr><th width="313">Value</th><th>Description</th></tr></thead><tbody><tr><td>success</td><td>Synchronization has been successfully performed.</td></tr><tr><td>failedToSyncOdometerCacheOnly</td><td>Synchronization has failed, only odometer data previously synchronized are returned</td></tr><tr><td>vehicleNotFound</td><td>An error occurred: the specified vehicle does not belong to the user.</td></tr><tr><td>cacheDataOnly</td><td>SynchronizationType has been set to <code>cache</code>.</td></tr></tbody></table>

### DKOdometerAddHistoryStatus

<table><thead><tr><th width="190">Value</th><th>Description</th></tr></thead><tbody><tr><td>success</td><td>The history entry has been successfully added to the odometer’s vehicle</td></tr><tr><td>error</td><td>An error occurred, for example if the user has no network.</td></tr><tr><td>vehicleNotFound</td><td>An error occurred: the specified vehicle does not belong to the user.</td></tr><tr><td>badDistance</td><td>An invalid distance value has been filled, for example if the provided distance is lower than the last distance odometer entry.</td></tr></tbody></table>

### DKOdometerUpdateHistoryStatus

<table><thead><tr><th width="211">Value</th><th>Description</th></tr></thead><tbody><tr><td>success</td><td>The history entry has been successfully updated.</td></tr><tr><td>error</td><td>An error occurred, for example if the user has no network.</td></tr><tr><td>historyNotFound</td><td>There is no matching odometer’s history for the provided historyId and vehicleId</td></tr><tr><td>vehicleNotFound</td><td>An error occurred: the specified vehicle does not belong to the user.</td></tr><tr><td>badDistance</td><td>An invalid distance value has been filled.</td></tr></tbody></table>

### DKOdometerDeleteHistoryStatus

<table><thead><tr><th width="241">Value</th><th>Description</th></tr></thead><tbody><tr><td>success</td><td>The history entry has been successfully deleted.</td></tr><tr><td>error</td><td>An error occurred, for example if the user has no network.</td></tr><tr><td>historyNotFound</td><td>There is no matching odometer’s history for the provided historyId and vehicleId</td></tr><tr><td>vehicleNotFound</td><td>An error occurred: the specified vehicle does not belong to the user.</td></tr><tr><td>lastOdometerError</td><td>An error occurred: it is not possible to delete the last odometer history.</td></tr></tbody></table>

### DKVehicleOdometer

<table><thead><tr><th width="240">Field</th><th width="142.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>analyzedDistance</td><td>Double</td><td>Distance accumulated during all the analyzed trips in km</td></tr><tr><td>distance</td><td>Double</td><td>Odometer last distance entry</td></tr><tr><td>estimatedYearDistance</td><td>Double</td><td>Estimated traveled distance for year in km</td></tr><tr><td>estimatedYearNbTrip</td><td>Int</td><td>Estimated number of trip for the current year</td></tr><tr><td>offsetDistance</td><td>Double</td><td>Difference between the real odometer distance and the analyzed distance in km</td></tr><tr><td>realDistance</td><td>Double</td><td>Real odometer distance in km</td></tr><tr><td>yearAnalyzedDistance</td><td>Double</td><td>Distance accumulated during all the analyzed trips for the current year in km</td></tr><tr><td>updateDate</td><td>Date?</td><td>Last update of the vehicle’s odometer</td></tr></tbody></table>

### DKVehicleOdometerHistory

| Field                | Type   | Description                                                                               |
| -------------------- | ------ | ----------------------------------------------------------------------------------------- |
| historyId            | Int    | Unique history identifier of the vehicle                                                  |
| analyzedDistance     | Double | Distance accumulated during all the analyzed trips in km                                  |
| distance             | Double | Mileage in km for this history                                                            |
| offsetDistance       | Double | Difference between the real odometer distance and the analyzed distance in km             |
| realDistance         | Double | Real odometer distance in km                                                              |
| updateDate           | Date?  | Date of the odometer history entry                                                        |
| yearAnalyzedDistance | Double | <p>Distance accumulated during all the analyzed trips for the current year</p><p><br></p> |
