Page Summary
-
This method adds data points to a dataset, and the dataset does not need to be previously created.
-
All points within the given dataset will be returned with subsequent calls to retrieve this dataset, and data points can belong to more than one dataset.
-
This method inserts data points without replacing existing data.
-
Authorization with specific fitness write scopes is required.
-
The request body requires properties such as
dataSourceId,maxEndTimeNs,minStartTimeNs, and a list ofpointobjects with their own properties.
Adds data points to a dataset. The dataset need not be previously created.
All points within the given dataset will be returned with subsquent calls
to retrieve this dataset. Data points can belong to more than one dataset.
This method does not use patch semantics: the data points provided are
merely inserted, with no existing data replaced. Try it now
.
Request
HTTP request
PATCH https://www.googleapis.com/fitness/v1/users/ userId /dataSources/ dataSourceId /datasets/ datasetId
Parameters
dataSourceId
string
datasetId
string
userId
string
me
to indicate
the authenticated user. Only me
is supported at this time.Authorization
This request requires authorization with at least one of the following scopes:
| Scope |
|---|
https://www.googleapis.com/auth/fitness.activity.write
|
https://www.googleapis.com/auth/fitness.location.write
|
https://www.googleapis.com/auth/fitness.body.write
|
https://www.googleapis.com/auth/fitness.nutrition.write
|
https://www.googleapis.com/auth/fitness.blood_pressure.write
|
https://www.googleapis.com/auth/fitness.blood_glucose.write
|
https://www.googleapis.com/auth/fitness.oxygen_saturation.write
|
https://www.googleapis.com/auth/fitness.body_temperature.write
|
https://www.googleapis.com/auth/fitness.reproductive_health.write
|
For more information, see the authentication and authorization page.
Request body
In the request body, supply the relevant portions of a Users.dataSources.datasets resource , according to the rules of patch semantics, with the following properties:
dataSourceId
string
maxEndTimeNs
long
minStartTimeNs
long
point[]
list
point[].
dataTypeName
string
point[].
endTimeNanos
long
point[].
startTimeNanos
long
point[].
value[]
list
Only one of integer and floating point fields will be populated, depending on the format enum value within data source's type field.
Response
If successful, this method returns a Users.dataSources.datasets resource in the response body.
Try it!
Use the APIs Explorer below to call this method on live data and see the response.


