- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- CivilTimeInterval
- DailyRollupDataPoint
- RestingHeartRatePersonalRangeRollupValue
- HeartRateVariabilityPersonalRangeRollupValue
- Examples
- Try it!
Roll up data points over civil time intervals for supported data types.
HTTP request
POST https://health.googleapis.com/v4/{parent=users/*/dataTypes/*}/dataPoints:dailyRollUp
The URL uses gRPC Transcoding syntax. To know more about valid error responses that can be thrown by this HTTP request, please refer to the service error catalog
Path parameters
| Parameters | |
|---|---|
parent |
Required. Parent data type of the Data Point collection. Format:
For a list of the supported data types see the |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{
"range": {
object ( |
| Fields | |
|---|---|
range |
Required. Closed-open range of data points that will be rolled up. The start and end times must be aligned with the aggregation window. The maximum range for |
windowSizeDays |
Optional. Aggregation window size, in number of days. Defaults to 1 if not specified. |
pageSize |
Optional. The maximum number of data points to return. If unspecified, at most 1440 data points will be returned. The maximum page size is 10000; values above that will be truncated accordingly. |
pageToken |
Optional. The |
dataSourceFamily |
Optional. The data source family name to roll up. If empty, data points from all available data sources will be rolled up. Format: The supported values are:
|
Response body
Response containing the list of rolled up data points.
If successful, the response body contains data with the following structure:
| JSON representation |
|---|
{
"rollupDataPoints": [
{
object ( |
| Fields | |
|---|---|
rollupDataPoints[] |
Values for each aggregation time window. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/googlehealth.activity_and_fitnesshttps://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonlyhttps://www.googleapis.com/auth/googlehealth.health_metrics_and_measurementshttps://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonlyhttps://www.googleapis.com/auth/googlehealth.locationhttps://www.googleapis.com/auth/googlehealth.location.readonlyhttps://www.googleapis.com/auth/googlehealth.nutritionhttps://www.googleapis.com/auth/googlehealth.nutrition.readonlyhttps://www.googleapis.com/auth/googlehealth.sleephttps://www.googleapis.com/auth/googlehealth.sleep.readonly
For more information, see the OAuth 2.0 Overview.
CivilTimeInterval
Counterpart of google.type.Interval, but using CivilDateTime.
| JSON representation |
|---|
{ "start": { object ( |
| Fields | |
|---|---|
start |
Required. The inclusive start of the range. |
end |
Required. The exclusive end of the range. |
DailyRollupDataPoint
Value of a daily rollup for a single civil time interval (aggregation window)
| JSON representation |
|---|
{ "civilStartTime": { object ( |
| Fields | |
|---|---|
civilStartTime |
Start time of the window this value aggregates over |
civilEndTime |
End time of the window this value aggregates over |
Union field
The field names usually follow the format If there were no data points in this interval, the value will not be set. These messages represent the aggregated data payload for each data type and are embedded within the |
|
steps |
Returned by default when rolling up data points from the |
floors |
Returned by default when rolling up data points from the |
heartRate |
Returned by default when rolling up data points from the |
restingHeartRatePersonalRange |
Returned by default when rolling up data points from the |
heartRateVariabilityPersonalRange |
Returned by default when rolling up data points from the |
weight |
Returned by default when rolling up data points from the |
altitude |
Returned by default when rolling up data points from the |
distance |
Returned by default when rolling up data points from the |
bodyFat |
Returned by default when rolling up data points from the |
totalCalories |
Returned by default when rolling up data points from the |
activeZoneMinutes |
Returned by default when rolling up data points from the |
sedentaryPeriod |
Returned by default when rolling up data points from the |
runVo2Max |
Returned by default when rolling up data points from the |
caloriesInHeartRateZone |
Returned by default when rolling up data points from the |
activityLevel |
Returned by default when rolling up data points from the |
hydrationLog |
Returned by default when rolling up data points from the |
timeInHeartRateZone |
Returned by default when rolling up data points from the |
activeMinutes |
Returned by default when rolling up data points from the |
RestingHeartRatePersonalRangeRollupValue
Represents the rollup value for the daily resting heart rate data type.
| JSON representation |
|---|
{ "beatsPerMinuteMin": number, "beatsPerMinuteMax": number } |
| Fields | |
|---|---|
beatsPerMinuteMin |
The lower bound of the user's daily resting heart rate personal range. |
beatsPerMinuteMax |
The upper bound of the user's daily resting heart rate personal range. |
HeartRateVariabilityPersonalRangeRollupValue
Represents the result of the rollup of the user's daily heart rate variability personal range.
| JSON representation |
|---|
{ "averageHeartRateVariabilityMillisecondsMin": number, "averageHeartRateVariabilityMillisecondsMax": number } |
| Fields | |
|---|---|
averageHeartRateVariabilityMillisecondsMin |
The lower bound of the user's average heart rate variability personal range. |
averageHeartRateVariabilityMillisecondsMax |
The upper bound of the user's average heart rate variability personal range. |