Updates the specified data source. The dataStreamId
,
dataType
, type
, dataStreamName
, and
device
properties with the exception of version
,
cannot be modified.
Data sources are identified by their dataStreamId
.
Try it now.
Request
HTTP request
PUT https://www.googleapis.com/fitness/v1/users/userId/dataSources/dataSourceId
Parameters
Parameter name | Value | Description |
---|---|---|
Path parameters | ||
dataSourceId |
string |
The data stream ID of the data source to update. |
userId |
string |
Update the data source for the person identified. Use 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 a Users.dataSources resource with the following properties:
Property name | Value | Description | Notes |
---|---|---|---|
Required Properties | |||
application |
nested object |
Information about an application which feeds sensor data into the platform. | |
application.name |
string |
The name of this application. This is required for REST clients, but we do not enforce uniqueness of this name. It is provided as a matter of convenience for other developers who would like to identify which REST created an Application or Data Source. | |
dataStreamId |
string |
A unique identifier for the data stream produced by this data source. The identifier includes:
The exact format of the data stream ID created by an Android application is: type:dataType.name The exact format of the data stream ID created by a REST client is: type:dataType.name When any of the optional fields that make up the data stream ID are absent, they will be omitted from the data stream ID. The minimum viable data stream ID would be: type:dataType.name:developer project number Finally, the developer project number and device UID are obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the developer project number in clear and normal form. This means a client will see a different set of data_stream_ids than another client with different credentials. |
|
dataType |
nested object |
The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. | |
dataType.field[] |
list |
A field represents one dimension of a data type. | |
dataType.field[].format |
string |
The different supported formats for each field in a data type.
Acceptable values are:
|
|
dataType.field[].name |
string |
Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type. | |
dataType.name |
string |
Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. | |
device |
nested object |
Representation of an integrated device (such as a phone or a wearable) that can hold sensors. | |
device.manufacturer |
string |
Manufacturer of the product/hardware. | |
device.model |
string |
End-user visible model name for the device. | |
device.type |
string |
A constant representing the type of the device.
Acceptable values are:
|
|
device.uid |
string |
The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the uid field in clear and normal form. The obfuscation preserves equality; that is, given two IDs, if id1 == id2, obfuscated(id1) == obfuscated(id2). |
|
device.version |
string |
Version string for the device hardware/software. | |
type |
string |
A constant describing the type of this data source. Indicates whether this data source produces raw or derived data.
Acceptable values are:
|
Response
If successful, this method returns a Users.dataSources resource in the response body.
Try it!
Use the APIs Explorer below to call this method on live data and see the response.