- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- RollupDataPoint
- Examples
- Try it!
Roll up data points over physical time intervals for supported data types.
HTTP request
POST https://health.googleapis.com/v4/{parent=users/*/dataTypes/*}/dataPoints:rollUp
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 maximum range for |
windowSize |
Required. The size of the time window to group data points into before applying the aggregation functions. Must be at least 1 second. If the requested range is not an exact multiple of A duration in seconds with up to nine fractional digits, ending with ' |
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 nextPageToken from a previous request, if any. All other request fields need to be the same as in the initial request when the page token is specified. |
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:
Callers that were only granted write scopes for the requested data type may only read the data they wrote themselves: their requests are implicitly restricted to If no data point matches the requested data source family, the response is an empty list rather than an error. |
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. |
nextPageToken |
A token, which can be sent as |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/googlehealth.activity_and_fitness.readonlyhttps://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonlyhttps://www.googleapis.com/auth/googlehealth.location.readonlyhttps://www.googleapis.com/auth/googlehealth.nutrition.readonlyhttps://www.googleapis.com/auth/googlehealth.sleep.readonlyhttps://www.googleapis.com/auth/googlehealth.reproductive_health.readonlyhttps://www.googleapis.com/auth/googlehealth.logged_symptoms.readonlyhttps://www.googleapis.com/auth/googlehealth.mindfulness.readonlyhttps://www.googleapis.com/auth/googlehealth.ecg.readonlyhttps://www.googleapis.com/auth/googlehealth.irn.readonlyhttps://www.googleapis.com/auth/googlehealth.activity_and_fitness.writeonlyhttps://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.writeonlyhttps://www.googleapis.com/auth/googlehealth.nutrition.writeonlyhttps://www.googleapis.com/auth/googlehealth.sleep.writeonlyhttps://www.googleapis.com/auth/googlehealth.reproductive_health.writeonlyhttps://www.googleapis.com/auth/googlehealth.logged_symptoms.writeonlyhttps://www.googleapis.com/auth/googlehealth.mindfulness.writeonly
For more information, see the OAuth 2.0 Overview.
RollupDataPoint
Value of a rollup for a single physical time interval (aggregation window) of reconciled data points from all data sources, excluding those data points that are identified as recorded by wearables in intervals when they were not actually worn.
| JSON representation |
|---|
{ "startTime": string, "endTime": string, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "steps": { object ( |
| Fields | |
|---|---|
startTime |
Start time of the window this value aggregates over Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
endTime |
End time of the window this value aggregates over Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
Outcome of a rollup of the requested data type.
The field names usually follow the format If there were no manual, on-wrist data points in this interval, the value will not be set. When the value is set, but the data shows zero, e.g. 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 |
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 |
nutritionLog |
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 |
swimLengthsData |
Returned by default when rolling up data points from the |
coreBodyTemperature |
Returned by default when rolling up data points from the |
activeEnergyBurned |
Returned by default when rolling up data points from the |
bloodGlucose |
Returned by default when rolling up data points from the |
| End of mutually exclusive fields. | |