Data format
Request body format
The POST
requests made to webhook have a JSON body with the following structure:
{
"uuid": "<uuid of the user configured in SDK>",
"data": {
"steps": [
{
"value": 29836,
"source": "google_fit" or "apple_healthkit",
"end_time": 1673793698220,
"start_time": 1672994707450,
"source_device": "User's iPhone",
"manual_entry": false
}
],
"calories": [
{
"value": 112.94265772702549,
"source": "google_fit",
"end_time": 1673793698220,
"start_time": 1672994707450,
"source_device": null,
"manual_entry": false
}
],
"move_minutes": [
{
"value": 288,
"source": "google_fit",
"end_time": 1673793698220,
"start_time": 1672994707450,
"source_device": null,
"manual_entry": true
}
]
}
}
The top level of the JSON structure contains two entries:
uuid
: The UUID of the user configured in the SDK.data
: A map containing the health and fitness data. Each entry in the map has a key that represents the data type name, and a value that is a list of entries.Each entry in the list has the following attributes:
source
: The platform from where the data came.start_time
: Start time for the data, represented as a UNIX timestamp in milliseconds.end_time
: End time for the data, represented as a UNIX timestamp in milliseconds.value
: Value of that data type during the time range. The value can be an integer, float, etc. based on the data type.manual_entry
: A boolean value that indicates whether the data point was entered manually by the user.source_device
: The name of the device on which this data was captured. This attribute is only filled for Apple Healthkit data.
Platform keys
The table below shows the platforms and the keys used in the request body:
Platform | The key used in the request body |
---|---|
Google Fit | google_fit |
Apple Healthkit | apple_healthkit |
Fitbit | fitbit |
Strava | strava |
Garmin | garmin |
Data types keys
The table below shows the fitness data types, the key used in the request body, and the data type:
Fitness Data | Key used in Request Body | Value type |
---|---|---|
Steps | steps | Integer |
Sleep | sleep | Integer |
Move Minutes | move_minutes | Integer |
Distance Moved | move_distance | Float |
Calories Burned | calories | Float |
Calories BMR | calories_bmr | Float |
Weight | weight | Float |
Height | height | Float |
Blood Glucose | blood_glucose | Float |
Bloood Oxygen | blood_oxygen | Float |
Water Consumed | water_consumed | Float |
Sleep type
In addition to the value
field, which represents the duration of a sleep phase, sleep data also includes a sleep_type
field that indicates the type of sleep. The sleep_type
field provides information about the specific sleep phase. The possible values for sleep_type
are:
awake
: Represents the awake phase during sleep.light
: Indicates light sleep.deep
: Refers to deep sleep.rem
: Represents the rapid eye movement (REM) sleep phase.unspecified
: Indicates that the sleep phase is unspecified or unknown.
By using the sleep_type
field from the sleep data, you can gain insights into the different phases of a user's sleep pattern.