heartbeatAggregatesList API Endpoint (EU)

The heartbeatAggregatesList API enables Zendrive customers in the EU region to obtain all the heartbeat data for a given list of users, or for all users.

Requirements

The heartbeatAggregates (EU Region) API serves the following functions:

  • Returns the heartbeat information of all users of an application for a specified time interval (day, week, or month).

  • Returns the heartbeat information of multiple users of a particular application for a specified time interval (day, week, or month).

The heartbeatAggregatesList API will be able to return the data after 24 to 48 hours.

API Details

GET URL: https://api.eu.zendrive.com/v4/heartbeats

Headers

Name
Type
Description

Authorization*

String

APIKEY <APIKEY>

end_date*

String

The end_date for aggregation.

interval_type*

String

Day, week or month.

User_ids

String

List of users.

page_key

String

Key to obtain the next set of records.

{
    "aggregates": [
        {
            "user_id": "123",
            "data": [
                {
                    "healthy_time": 86400,
                    "healthy_intervals": [
                        {
                            "start_time": 1689033600000,
                            "end_time": 1689120000000
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 0,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-11"
                },
                {
                    "healthy_time": 59591,
                    "healthy_intervals": [
                        {
                            "start_time": 1689562902093,
                            "end_time": 1689622493279
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 26809,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-17"
                },
                {
                    "healthy_time": 43200,
                    "healthy_intervals": [
                        {
                            "start_time": 1689654782485,
                            "end_time": 1689676382485
                        },
                        {
                            "start_time": 1689687025042,
                            "end_time": 1689708625042
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 43200,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-18"
                },
                {
                    "healthy_time": 81306,
                    "healthy_intervals": [
                        {
                            "start_time": 1689379200000,
                            "end_time": 1689398199160
                        },
                        {
                            "start_time": 1689402804905,
                            "end_time": 1689465112540
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 5094,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-15"
                },
                {
                    "healthy_time": 54182,
                    "healthy_intervals": [
                        {
                            "start_time": 1689485473522,
                            "end_time": 1689507073522
                        },
                        {
                            "start_time": 1689508188826,
                            "end_time": 1689540771124
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 32218,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-16"
                },
                {
                    "healthy_time": 73505,
                    "healthy_intervals": [
                        {
                            "start_time": 1689120000000,
                            "end_time": 1689193505999
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 12895,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-12"
                },
                {
                    "healthy_time": 55521,
                    "healthy_intervals": [
                        {
                            "start_time": 1689222652781,
                            "end_time": 1689278174185
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 30879,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-13"
                },
                {
                    "healthy_time": 67499,
                    "healthy_intervals": [
                        {
                            "start_time": 1689311700680,
                            "end_time": 1689379200000
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 18901,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-14"
                }
            ]
        },
        {
            "user_id": "12345",
            "data": [
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 62105,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689489894857,
                            "end_time": 1689552000000
                        }
                    ],
                    "unknown_time": 24295,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-16"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689552000000,
                            "end_time": 1689638400000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "O",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-17"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689120000000,
                            "end_time": 1689206400000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "O",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-12"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 71916,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689033600000,
                            "end_time": 1689038957111
                        },
                        {
                            "start_time": 1689053440030,
                            "end_time": 1689120000000
                        }
                    ],
                    "unknown_time": 14484,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-11"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689292800000,
                            "end_time": 1689379200000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-14"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689206400000,
                            "end_time": 1689292800000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-13"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 76441,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689379200000,
                            "end_time": 1689455641262
                        }
                    ],
                    "unknown_time": 9959,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-15"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689638400000,
                            "end_time": 1689724800000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-18"
                }
            ]
        }
    ],
    "start_date": "2023-07-11",
    "end_date": "2023-07-18",
    "page_key":4555985"
}

Sample Curl Script

curl --location --request GET 'https://api.eu.zendrive.com/v4/heartbeats?interval_type=day&end_date=2023-01-15' \
--header 'Authorization: APIKEY api_key'

Request Parameter Fields

Key
Description
Required / Optional

end_date

The end_date for aggregation.

Required

interval_type

Choose from day, week, or month.

  • Day: Returns all the heartbeats on end_date for all users.

  • Week: Returns all the heartbeats in the interval (end_date - 7 days, end_date) for all users.

  • Month: Returns all the heartbeats in the interval (end_date - 30 days, end_date) for all users.

Required

user_ids

List of users for whom you require the heartbeat data. Use commas to separate the user Ids. This field can have a maximum of 50 unique user_ids. If this field is left empty, the data for all the users is returned in a paginated format.

Optional

page_key

Key to obtaining the next set of records. You will receive this key after you make your first request.

Optional

Sample Response

{
    "aggregates": [
        {
            "user_id": "123",
            "data": [
                {
                    "healthy_time": 86400,
                    "healthy_intervals": [
                        {
                            "start_time": 1689033600000,
                            "end_time": 1689120000000
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 0,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-11"
                },
                {
                    "healthy_time": 59591,
                    "healthy_intervals": [
                        {
                            "start_time": 1689562902093,
                            "end_time": 1689622493279
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 26809,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-17"
                },
                {
                    "healthy_time": 43200,
                    "healthy_intervals": [
                        {
                            "start_time": 1689654782485,
                            "end_time": 1689676382485
                        },
                        {
                            "start_time": 1689687025042,
                            "end_time": 1689708625042
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 43200,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-18"
                },
                {
                    "healthy_time": 81306,
                    "healthy_intervals": [
                        {
                            "start_time": 1689379200000,
                            "end_time": 1689398199160
                        },
                        {
                            "start_time": 1689402804905,
                            "end_time": 1689465112540
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 5094,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-15"
                },
                {
                    "healthy_time": 54182,
                    "healthy_intervals": [
                        {
                            "start_time": 1689485473522,
                            "end_time": 1689507073522
                        },
                        {
                            "start_time": 1689508188826,
                            "end_time": 1689540771124
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 32218,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-16"
                },
                {
                    "healthy_time": 73505,
                    "healthy_intervals": [
                        {
                            "start_time": 1689120000000,
                            "end_time": 1689193505999
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 12895,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-12"
                },
                {
                    "healthy_time": 55521,
                    "healthy_intervals": [
                        {
                            "start_time": 1689222652781,
                            "end_time": 1689278174185
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 30879,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-13"
                },
                {
                    "healthy_time": 67499,
                    "healthy_intervals": [
                        {
                            "start_time": 1689311700680,
                            "end_time": 1689379200000
                        }
                    ],
                    "unhealthy_time": 0,
                    "unhealthy_intervals": [],
                    "unknown_time": 18901,
                    "device_model": "iPhone SE 2nd Gen",
                    "platform_string": "iOS",
                    "overall_color_code": "G",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "G",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": null,
                    "user_id": "123",
                    "date": "2023-07-14"
                }
            ]
        },
        {
            "user_id": "12345",
            "data": [
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 62105,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689489894857,
                            "end_time": 1689552000000
                        }
                    ],
                    "unknown_time": 24295,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-16"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689552000000,
                            "end_time": 1689638400000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "O",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-17"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689120000000,
                            "end_time": 1689206400000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "O",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-12"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 71916,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689033600000,
                            "end_time": 1689038957111
                        },
                        {
                            "start_time": 1689053440030,
                            "end_time": 1689120000000
                        }
                    ],
                    "unknown_time": 14484,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-11"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689292800000,
                            "end_time": 1689379200000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-14"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689206400000,
                            "end_time": 1689292800000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-13"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 76441,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689379200000,
                            "end_time": 1689455641262
                        }
                    ],
                    "unknown_time": 9959,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-15"
                },
                {
                    "healthy_time": 0,
                    "healthy_intervals": [],
                    "unhealthy_time": 86400,
                    "unhealthy_intervals": [
                        {
                            "start_time": 1689638400000,
                            "end_time": 1689724800000
                        }
                    ],
                    "unknown_time": 0,
                    "device_model": "samsung-SM-A536E",
                    "platform_string": "android",
                    "overall_color_code": "R",
                    "setup_color_code": "G",
                    "location_permissions_color_code": "R",
                    "location_service_color_code": "G",
                    "activity_permissions_color_code": "G",
                    "background_restrictions_color_code": "G",
                    "precise_location_color_code": "G",
                    "battery_optimization_color_code": "G",
                    "user_id": "12345",
                    "date": "2023-07-18"
                }
            ]
        }
    ],
    "start_date": "2023-07-11",
    "end_date": "2023-07-18",
    "page_key": “4555985"
}

Response Fields

Field
Description

aggregates.date

This field contains the start and end times, unhealthy times, unknown times and other data for a given user.

aggregates.day_level_aggregates

Various values for the corresponding aggregates.date. See the Day Level Field Aggregates able below.

start_date

Start date of the dataset for the requested period.

end_date

End date of the dataset for the requested period.

page_key

Key to obtaining the next set of records. You will receive this key after you make your first request.

Day Level Aggregates Fields

Field
Description

healthy_time

The duration in seconds during which all of the user's known devices are healthy.

healthy_intervals

Periods of time during which the health of the user's devices is good.

healthy_intervals.start_time

Unix timestamps for start of healthy intervals.

healthy_intervals.end_time

Unix timestamps for end of healthy intervals.

unhealthy_time

The duration in seconds during which at least 1 of the user's known devices is unhealthy.

unhealthy_intervals

Periods during which the health of the user's devices is poor.

unhealthy_intervals.start_time

Unix timestamps for start of unhealthy intervals.

unhealthy_intervals.end_time

Unix timestamps for end of unhealthy intervals.

unknown_time

Time in seconds for which the health of the user's devices is unknown.

device_model

Make of the user's device.

platform_string

OS of the user's device (iOS or Android).

overall_color_code

This value indicates whether the device is healthy. Possible values are as follows:

G: Green for a healthy value.

O: Orange for a partially healthy value.

R: Red for an unhealthy value.

setup_color_code

This value indicates whether the zendrive.setup method was called successfully. Possible values: G, O, R.

location_permissions_color_code

This value indicates whether the

Location permission is enabled on the device. Possible values: G, O, R.

precise_location_color_code

This value indicates whether the Precise Location permission is enabled on the device. Possible values: G, O, R.

Note: Healthy and unhealthy intervals and unknown times are calculated on the basis of the overall heartbeat state.

Change in these values will occur only in cases where the Precise Location permission is enabled, for Android v12 and above, and iOS v14 and above.

location_service_color_code

This value indicates whether GPS data is enabled on the device. Possible values: G, O, R.

activity_permissions_color_code

This value indicates whether the Physical Activity permission is enabled on the device. Possible values: G, O, R.

background_restriction_color_code

This value indicates whether the Background Restriction permission is disabled on the device. Possible values: G, O, R.

battery_optimization_color_code

This value indicates whether the Battery Optimization permission is disabled on the device. Ideally this permission should be disabled (G). Possible values: G, O, R.

The value will be NULL on Android devices where the Zendrive SDK version is below 9.2, and on iOS devices irrespective of their SDK versions.

Important Notes:

  1. The heartbeatAggregatesList API responds within 30 seconds.

  2. The retrieved data will be of type json.

  3. You can specify the interval type in terms of day, or week, or month. You can also specify a custom interval, including a start date and an end date.

  4. You will receive a page key in response to your first request, which you need to provide along with all subsequent requests. Note that all other parameters (user_id, interval_type and end_date) should remain the same as in the primary request.

  5. The page_key parameter performs the function of page forward as well.

Was this helpful?