# Application diagnoses

This API returns information about a user's application diagnosis. It can be used to determine whether the application settings are correct:&#x20;

* In a nominal state, the user's trips will be detected and recorded.
* If the smartphone is not correctly configured, or if the user has not granted the proper accesses for the application, the trip recording may be altered.

When a user reports an issue with trip detection or recording, this API can help identify the most probable cause, which can greatly accelerate user support.

{% 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/96d593da201f0-list-all-driver-s-application-diagnoses).
{% endhint %}

{% openapi src="/files/FUCviEkq8g6ZrHWNC5pv" path="/drivekit/admin/drivers/{userId}/application/diagnoses" method="get" %}
[drivekit-admin-drivers-v3-app-diagnosis.yml](https://2525923625-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LXYIG5U3AO65YYFWJRK%2Fuploads%2FUWinwWimRva4OCQunzFy%2Fdrivekit-admin-drivers-v3-app-diagnosis.yml?alt=media\&token=cb54575c-653e-4bdf-a793-fdf491acb36a)
{% endopenapi %}

## Path parameters

<table><thead><tr><th width="134.33333333333331">Field</th><th width="109">Type</th><th>Description</th></tr></thead><tbody><tr><td>userId</td><td><code>string</code></td><td>Driver's unique identifier</td></tr></tbody></table>

## Response

The table below summarizes the list of a driver application's diagnosis data.

<table><thead><tr><th width="180.33333333333331">Field</th><th width="175">Type</th><th>Description</th></tr></thead><tbody><tr><td>userInfo</td><td><a href="#userinfo">UserInfo</a></td><td>User information</td></tr><tr><td>diagnoses</td><td><code>array[object]</code></td><td>List of all the diagnoses related to the driver’s account. <em>See</em> <a href="#diagnosisresponse"><em>DiagnosisResponse</em></a> </td></tr></tbody></table>

{% hint style="info" %}
In the nominal case, the user's account is active on one device, and the `diagnoses` array will contain a single entry.

However, if the account is active on multiple devices, or if the application was reinstalled, the array will include one entry for each installation. Each device is uniquely identified by its `installationId`.
{% endhint %}

### UserInfo

The table below summarizes the content of the `userInfo` object.

<table><thead><tr><th width="178.33333333333331">Field</th><th width="112">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 firstname</td></tr><tr><td>lastname</td><td><code>string</code></td><td>User lastname</td></tr><tr><td>companyName</td><td><code>string</code></td><td>Company name</td></tr><tr><td>registerDate</td><td><code>string</code></td><td><p>User registration date </p><p><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></p></td></tr><tr><td>firstTrip</td><td><code>string</code></td><td><p>Date of the first trip</p><p><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></p></td></tr><tr><td>lastTrip</td><td><code>string</code></td><td><p>Date of the last trip</p><p><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></p></td></tr></tbody></table>

### DiagnosisResponse

The table below summarizes the content of the `diagnoses` array items.

<table><thead><tr><th width="180.33333333333331">Field</th><th width="175">Type</th><th>Description</th></tr></thead><tbody><tr><td>installationId</td><td><code>string</code></td><td>Unique identifier of an installation</td></tr><tr><td>smartphoneData</td><td><a href="#smartphonedata">SmartphoneData</a></td><td>Information about the user's smartphone</td></tr><tr><td>lastUpdate</td><td><code>string</code></td><td><p>Last update of application diagnostic data</p><p><em>Date format: <code>YYYY-MM-dd’T’HH:mm:ss.SSSZ</code></em></p></td></tr><tr><td>status</td><td><code>string</code></td><td><p>Global smartphone status, which indicates if the mobile application is configured to record user trips (see <a href="#global-status">the definition</a>).</p><p><em>Allowed values: <code>VALID</code>, <code>WARNING</code>, <code>ERROR</code></em></p></td></tr><tr><td>comments</td><td><code>array[object]</code></td><td>Short description of mobile application configuration status. <em>See</em> <a href="#comments"><em>Comment</em></a></td></tr><tr><td>sensors</td><td><a href="#sensors">Sensors</a></td><td>Sensors status</td></tr><tr><td>permissions</td><td><a href="#permissions">Permissions</a></td><td>Permissions status</td></tr><tr><td>settings</td><td><a href="#settings">Settings</a></td><td>Additional settings status</td></tr><tr><td>events</td><td><a href="#events">Events</a></td><td>Events related to user actions</td></tr></tbody></table>

### SmartphoneData

The table below summarizes the content of the `smartphoneData` object.

<table><thead><tr><th width="226">Field</th><th width="158.33333333333331">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>

### Comments

The table below summarizes the content of the `comments` object.

<table><thead><tr><th width="146.33333333333331">Field</th><th width="175">Type</th><th>Description</th></tr></thead><tbody><tr><td>code</td><td><code>integer</code></td><td>Comment identifier</td></tr><tr><td>comment</td><td><code>string</code></td><td><p>Short description (in English)</p><p><em>See</em> <a href="#known-comments"><em>Known Comments</em></a></p></td></tr></tbody></table>

### Sensors

The table below summarizes the content of the `sensors` object.

<table><thead><tr><th width="144.33333333333331">Field</th><th width="119">Type</th><th>Description</th></tr></thead><tbody><tr><td>location</td><td><code>string</code></td><td><p>Location sensor status</p><p><em>Allowed values: <code>ENABLED</code>, <code>DISABLED</code>, <code>UNKNOWN</code></em></p></td></tr><tr><td>bluetooth</td><td><code>string</code></td><td><p>Bluetooth sensor status</p><p><em>Allowed values: <code>ENABLED</code>, <code>DISABLED</code>, <code>UNKNOWN</code></em></p></td></tr></tbody></table>

### Permissions

The table below summarizes the content of the `permissions` object.

<table><thead><tr><th width="154.33333333333331">Field</th><th width="162">Type</th><th>Description</th></tr></thead><tbody><tr><td>location</td><td><code>string</code></td><td><p>Location permission status</p><p><em>Allowed values: <code>GRANTED</code>, <code>DENIED</code>, <code>UNKNOWN</code></em></p></td></tr><tr><td>bluetooth</td><td><code>string</code></td><td><p>Bluetooth permission status</p><p><em>Allowed values: <code>GRANTED</code>, <code>DENIED</code>, <code>UNKNOWN</code></em></p></td></tr><tr><td>activity</td><td><code>string</code></td><td><p>Activity permission status</p><p><em>Allowed values: <code>GRANTED</code>, <code>DENIED</code>, <code>UNKNOWN</code></em></p></td></tr><tr><td>notification</td><td><code>string</code></td><td><p>Notification permission status</p><p><em>Allowed values: <code>GRANTED</code>, <code>DENIED</code>, <code>UNKNOWN</code></em></p></td></tr></tbody></table>

### Settings

The table below summarizes the content of the `settings` object.

<table><thead><tr><th width="220.33333333333331">Field</th><th width="106">Type</th><th>Description</th></tr></thead><tbody><tr><td>permissionAutodelete</td><td><code>string</code></td><td><p>Status of permission revocation functionality in case of prolonged inactivity (Android only).</p><p><em>Allowed values: <code>ENABLED</code>, <code>DISABLED</code>, <code>UNKNOWN</code>, <code>NOT_APPLICABLE</code></em></p><p><br></p></td></tr><tr><td>batteryOptimisation</td><td><code>string</code></td><td><p>Battery optimization status (Android only)</p><p><em>Allowed values: <code>ENABLED</code>, <code>DISABLED</code>, <code>UNKNOWN</code>, <code>NOT_APPLICABLE</code></em></p></td></tr><tr><td>lowPowerMode</td><td><code>string</code></td><td><p>Low power mode status (iOS only)</p><p><em>Allowed values: <code>ENABLED</code>, <code>DISABLED</code>, <code>UNKNOWN</code>, <code>NOT_APPLICABLE</code></em></p></td></tr></tbody></table>

### Events

The table below summarizes the content of the `events` object.

<table><thead><tr><th width="124.33333333333331">Field</th><th width="139">Type</th><th>Description</th></tr></thead><tbody><tr><td>device</td><td><code>string</code></td><td><p>Status indicating whether the phone is on</p><p><em>Allowed values: <code>TURNED_ON</code>, <code>TURNED_OFF</code>, <code>UNKNOWN</code></em></p></td></tr><tr><td>app</td><td><code>string</code></td><td><p>Status indicating whether the application is installed on the phone</p><p><em>Allowed values: <code>INSTALLED</code>, <code>UNINSTALLED</code>, <code>UNKNOWN</code></em></p></td></tr><tr><td>user</td><td><code>string</code></td><td><p>Status indicating whether the user is logged in</p><p><em>Allowed values: <code>LOGGED_IN</code>, <code>LOGGED_OUT</code>, <code>UNKNOWN</code></em></p></td></tr></tbody></table>

## Definitions

### Global status

The global status value depends on the status of each individual parameter:&#x20;

<table><thead><tr><th width="130">Status</th><th>Description</th></tr></thead><tbody><tr><td><code>ERROR</code></td><td>At least one of the parameters is in CRITICAL state (🔴).</td></tr><tr><td><code>WARNING</code></td><td>At least one of the parameters is in WARNING state (🟡), but no parameter is in  CRITICAL state (🔴).</td></tr><tr><td><code>VALID</code></td><td>No parameter is in CRITICAL (🔴) or WARNING states (🟡).</td></tr></tbody></table>

{% hint style="info" %}
**Note:**&#x20;

We chose not to consider parameters with an `UNKNOWN` or `NOT_APPLICABLE` status in the global status. More informations about the global status can be retrieved in the [comments](#known-comments) section.
{% endhint %}

### Individual parameters criticality

The criticality of each parameter is determined by its status and, in some cases, is specific to the OS of the smartphone. We define 3 levels of criticality:

<table><thead><tr><th width="173">Level</th><th>Description</th></tr></thead><tbody><tr><td>🔴 CRITICAL</td><td>Trip detection and/or recording is not possible</td></tr><tr><td>🟡 WARNING</td><td>Trip detection and/or recording is impaired, and trips are likely to be lost</td></tr><tr><td>🟢 MINOR</td><td>Trip detection and/or recording should work as expected</td></tr></tbody></table>

The table below describes, for each parameter, the level of impact of a given status on trip detection and/or recording:

<table><thead><tr><th width="170">Type</th><th width="208">Parameter</th><th width="106" align="center">Criticality</th><th>Status</th></tr></thead><tbody><tr><td>sensors</td><td>location</td><td align="center">🔴</td><td><code>DISABLED</code> </td></tr><tr><td>sensors</td><td>bluetooth</td><td align="center">🟡</td><td><code>DISABLED</code> </td></tr><tr><td>permissions</td><td>location</td><td align="center">🔴</td><td><code>DENIED</code> </td></tr><tr><td>permissions</td><td>bluetooth</td><td align="center">🟡</td><td><code>DENIED</code> </td></tr><tr><td>permissions</td><td>activity</td><td align="center">🟡</td><td><code>DENIED</code> </td></tr><tr><td>permissions</td><td>notification</td><td align="center">🟢</td><td><code>GRANTED</code>, <code>DENIED</code></td></tr><tr><td>settings</td><td>permissionAutodelete</td><td align="center">🟢</td><td><code>ENABLED</code>, <code>DISABLED</code></td></tr><tr><td>settings</td><td>batteryOptimisation</td><td align="center">🟡</td><td><code>ENABLED</code></td></tr><tr><td>settings</td><td>lowPowerMode</td><td align="center">🟢</td><td><code>ENABLED</code>, <code>DISABLED</code></td></tr><tr><td>events</td><td>device</td><td align="center">🔴</td><td><code>TURNED_OFF</code></td></tr><tr><td>events</td><td>app</td><td align="center">🔴</td><td><code>UNINSTALLED</code></td></tr><tr><td>events</td><td>user</td><td align="center">🔴</td><td><code>LOGGED_OUT</code> </td></tr></tbody></table>

### Known Comments

The table below gives more details about the known values for the comments object. We encourage you to use the *comment code* to identify the messages, as the comment value might change in the future.

<table><thead><tr><th width="96" align="center">Code</th><th width="287">Condition</th><th>Comment</th></tr></thead><tbody><tr><td align="center">0</td><td>No issue detected</td><td>Trip detection and/or recording should work as expected</td></tr><tr><td align="center">1</td><td>At least one event in warning state</td><td>Trip detection and/or recording is impaired, and trips are likely to be lost</td></tr><tr><td align="center">2</td><td>At least one event in error state</td><td>Trip detection and/or recording is not possible</td></tr><tr><td align="center">3</td><td>The <code>lastUpdate</code> is more than 7 days in the past</td><td>The data has not been updated for more than 7 days. It is not possible to guarantee that the current application settings are correct.</td></tr><tr><td align="center">4</td><td>The location sensor status OR the location permission status are <code>UNDEFINED</code></td><td>Location sensor status or the permission to access the location sensor could not be retrieved. It is not possible to determine if the application is running normally.</td></tr><tr><td align="center">5</td><td>Multiple phone models were used at the same time in the last 30 days Or, at least two diagnoses with a different <code>installationId</code> in the last 7 days</td><td>The user account is used in more than one smartphone.</td></tr><tr><td align="center">6</td><td>If an installationId is present, only no more than one diagnosis has been updated in the last 7 days</td><td>A single smartphone has been connected to the user account in the last 7 days.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.drivequant.com/backend/driver/application-diagnoses.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
