# \*User & Permissions Status | Heartbeats

{% hint style="info" %}
Heartbeats - system information that we receive from SDK in background. Average period of heartbeats is around 2 hours, but it also depends on a stability of user's internet connection.

Heartbeats help to indicate if the user has an installed application with active SDK and also shows other system information such as statuses of granted permissions, device model, OS version, etc.
{% endhint %}

{% hint style="danger" %}
NOTE: all the API methods below will be replaced with new ones before 31.03.2021
{% endhint %}

{% content-ref url="/pages/-M2cbbSRbIXaO9xQ9y0l" %}
[API Authorization](/user-statistics-and-analytics/authentication.md)
{% endcontent-ref %}

{% content-ref url="/pages/-MRxoWMenKnDtjOMK0fP" %}
[Broken mention](broken://pages/-MRxoWMenKnDtjOMK0fP)
{% endcontent-ref %}

## Get the latest heartbeat for an individual user

<mark style="color:blue;">`GET`</mark> `https://mobilesdk.telematicssdk.com/api/heartbeats/get/v{version}/raw/users/{userId}/latest`

**Authorization:** Required as Admin with API Authorization Credentials

#### Query Parameters

| Name    | Type   | Description                |
| ------- | ------ | -------------------------- |
| Version | string | Value "1" is required here |
| userID  | string | User's deviceToken         |

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

```
{
    "Result": {
        "UserId": "736cbd83-a937-4889-ae79-af2d5b63d63d",
        "Heartbeat Date": "2020-12-03T06:24:14.9145253",
        "WiFi Enabled": true,
        "GPS Enabled": true,
        "Mobile Data Enabled": false,
        "Latitude": 43.4650551,
        "Longitude": 40.9211685,
        "Extended Data": {
            "Application": "v1.5.4.20201230.0001 (com.raxel.coreproduct)",
            "Device Has Been Rooted (Android)": "0",
            "Device Model": "iPhone8,4",
            "Device OS Version": "iOS 14.0.1",
            "GPS Permission Granted": "Always",
            "JailBreak (iOS)": "0",
            "Low Power Mode": "false",
            "Low Precise Location (iOS)": "false",
            "Motion & Fitness Permission Granted (iOS)": "YES",
            "Motion Activity Permission Granted (Android)": "false",
            "SDK Version": "RPSDK v5.9.0.204 - 2020-11-30T13:52:27+0300"
        }
    },
    "Status": 200,
    "Title": "",
    "Errors": []
}
```

{% endtab %}
{% endtabs %}

## Get the latest heartbeats for a list of users

<mark style="color:green;">`POST`</mark> `https://mobilesdk.telematicssdk.com/api/heartbeats/get/v{version}/raw/users/latest`

**Authorization:** Required as Admin with API Authorization Credentials\
\
**Note:** maximum list size is **20** tokens.

#### Query Parameters

| Name    | Type   | Description                |
| ------- | ------ | -------------------------- |
| Version | string | value "1" is required here |

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

```
{
"Result": [
        {
        "UserId": "736cbd83-a937-4889-ae79-af2d5b63d63d",
        "Heartbeat Date": "2020-12-03T06:24:14.9145253",
        "WiFi Enabled": true,
        "GPS Enabled": true,
        "Mobile Data Enabled": false,
        "Latitude": 43.4650551,
        "Longitude": 40.9211685,
        "Extended Data": {
            "Application": "v1.5.4.20201230.0001 (com.raxel.coreproduct)",
            "Device Has Been Rooted (Android)": "0",
            "Device Model": "iPhone8,4",
            "Device OS Version": "iOS 14.0.1",
            "GPS Permission Granted": "Always",
            "JailBreak (iOS)": "0",
            "Low Power Mode": "false",
            "Low Precise Location (iOS)": "false",
            "Motion & Fitness Permission Granted (iOS)": "YES",
            "Motion Activity Permission Granted (Android)": "false",
            "SDK Version": "RPSDK v5.9.0.204 - 2020-11-30T13:52:27+0300"
        }
    },
        {
        "UserId": "736cbd83-a937-4889-ae79-af2d5b63d63d",
        "Heartbeat Date": "2020-12-03T06:24:14.9145253",
        "WiFi Enabled": true,
        "GPS Enabled": true,
        "Mobile Data Enabled": false,
        "Latitude": 43.4650551,
        "Longitude": 40.9211685,
        "Extended Data": {
            "Application": "v1.5.4.20201230.0001 (com.raxel.coreproduct)",
            "Device Has Been Rooted (Android)": "0",
            "Device Model": "iPhone8,4",
            "Device OS Version": "iOS 14.0.1",
            "GPS Permission Granted": "Always",
            "JailBreak (iOS)": "0",
            "Low Power Mode": "false",
            "Low Precise Location (iOS)": "false",
            "Motion & Fitness Permission Granted (iOS)": "YES",
            "Motion Activity Permission Granted (Android)": "false",
            "SDK Version": "RPSDK v5.9.0.204 - 2020-11-30T13:52:27+0300"
        }
    }
],
    "Status": 200,
    "Title": "",
    "Errors": []
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Request Body" %}

```
{
  "Users": [
    "3fa85f64-5717-4562-b3fc-2c963f66afb6", // user's deviceToken
    "3fa85f64-5717-4562-b3fc-2c963f66afb6"
  ]
}
```

{% endtab %}
{% endtabs %}

## :point\_down: Fields dictionary

|                                              |                                                                                                                                                     |
| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| UserID                                       | User's deviceToken                                                                                                                                  |
| Heartbeat Date                               | The date of the latest heartbeat                                                                                                                    |
| WiFi Enabled                                 | true/false \| Shows the status of WiFI sensor                                                                                                       |
| GPS Enabled                                  | true/false \| Shows the status of GPS sensor                                                                                                        |
| Mobile Data Enabled                          | true/false \| Shows the status of mobile data                                                                                                       |
| Latitude                                     | Latest known latitude                                                                                                                               |
| Longitude                                    | Latest known longitude                                                                                                                              |
| Application                                  | Application                                                                                                                                         |
| Device Has Been Rooted (Android)             | 0 = false, 1 = true \| Shows if the Android device has been rooted.                                                                                 |
| Device Model                                 | Device Model                                                                                                                                        |
| Device OS Version                            | Device OS Version                                                                                                                                   |
| GPS Permissions Granted                      | Shows the status of app permissions to GPS sensor                                                                                                   |
| JailBreak (iOS)                              | 0 = false, 1 = true \| Shows if the iOS device has been hacked                                                                                      |
| Low Power Mode                               | true/false \| Shows if the low power mode is active (tracking doesn't work stable, when lower power mode is active)                                 |
| Low Precise location (iOS)                   | true/false \| Shows if the Low Precise Location mode is active on iOS devices (tracking doesn't work, when the low precise location mode is active) |
| Motion & Fitness Permission Granted (iOS)    | YES/NO \| Shows the status of app permission for Motion & Fitness on iOS devices                                                                    |
| Motion Activity Permission Granted (Android) | true/false \| Shows the status of app permission for Motion Activity on Android devices                                                             |

![DataTool](/files/-MWAHhaeJSiD49YFlWYL)


---

# 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-old.telematicssdk.com/platform-features/heartbeats.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.
