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
dataSourceId
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 a Users.dataSources resource with the following properties:
application
nested object
application.
name
string
dataStreamId
string
- The physical device's manufacturer, model, and serial number (UID).
- The application's package name or name. Package name is used when the data source was created by an Android application. The developer project number is used when the data source was created by a REST client.
- The data source's type.
- The data source's stream name.
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
dataType.
field[]
list
dataType.field[].
format
string
Acceptable values are:
- "
blob
" - "
floatList
" - "
floatPoint
" - "
integer
" - "
integerList
" - "
map
" - "
string
"
dataType.field[].
name
string
dataType.
name
string
device
nested object
device.
manufacturer
string
device.
model
string
device.
type
string
Acceptable values are:
- "
chestStrap
" - "
headMounted
" - "
phone
" - "
scale
" - "
smartDisplay
" - "
tablet
" - "
unknown
" - "
watch
"
device.
uid
string
The obfuscation preserves equality; that is, given two IDs, if id1 == id2, obfuscated(id1) == obfuscated(id2).
device.
version
string
type
string
Acceptable values are:
- "
derived
" - "
raw
"
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.