I am trying to add a specific datasource and the scopes are
https://www.googleapis.com/auth/fitness.activity.read
https://www.googleapis.com/auth/fitness.activity.write
But when I try to do so. It returns me an error of
{
"reason": "invalidArgument",
"message": "Data type does not match well-known data type with the same name",
"domain": "global"
}
I send POST request to this URL
https://www.googleapis.com/fitness/v1/users/me/dataSources
Here is my request body
{
"dataStreamName": "MyDataSource",
"type": "derived",
"application": {
"detailsUrl": "http://example.com",
"name": "Foo Example App",
"version": "1"
},
"dataType": {
"field": [
{
"name": "activty_type",
"format": "integer"
}
],
"name": "com.google.activity.segment"
},
"device": {
"manufacturer": "Example Manufacturer",
"model": "ExampleTablet",
"type": "tablet",
"uid": "1000001",
"version": "1.0"
}
}
I am using PHP/Laravel as a language and I use CURL as an http request library. Can someone tell me what did I do wrong? Some of the scopes are successfully added but there are others that cannot be added.
Google docs reference: https://developers.google.com/fit/datatypes/activity?authuser=3