google-api-nodejs-client icon indicating copy to clipboard operation
google-api-nodejs-client copied to clipboard

How to get data of type com.google.activity.summary?

Open ibrag474 opened this issue 3 years ago • 0 comments

I found a very useful datatype - com.google.activity.summary, but I cannot figure out how to use it. Link to the docs https://developers.google.com/fit/datatypes/aggregate#rest . I tried this code:

const activitySummary =  await fitness.users.dataset.aggregate({
                        userId: 'me',
                        requestBody: {
                            aggregateBy: [
                                {
                                    dataTypeName: "com.google.activity.summary"
                                },

                            ],
                            startTimeMillis: 1663189200000,
                            endTimeMillis:   1663338945118
                        }
})

Error:

code: 400,
  errors: [
    {
      message: 'no default datasource found for: com.google.activity.summary',
      domain: 'global',
      reason: 'invalidArgument'
    }
  ]

Is it even possible to use it with this lib?

ibrag474 avatar Sep 16 '22 23:09 ibrag474