1

I know this has been asked similarly in two other threads, but even with both of those I still have not been able to get a simple step-count.

I've been going through the documentation and have been sending requests through OAuth 2.0 Playground but I can't for the life of me get any meaningful numbers in a response, or I fear I'm overlooking something or looking in the wrong place.

What I've tried: 1) Got all data sources at this request URL: https://www.googleapis.com/fitness/v1/users/{userId}/dataSources

2) Gone through two specific SO threads: One, Two

From suggestions there, I sent this request:

https://www.googleapis.com/fitness/v1/users/me/dataSources/derived:com.google.step_count.delta:com.google.android.gms:estimated_steps/datasets/{maxtime}-{mintime}

with values for maxtime/mintime that corresponded from April last year to today and the response I got was this:

{
"minStartTimeNs": {mintime},
"maxEndTimeNs": {maxtime},
"dataSourceId": "derived:com.google.step_count.delta:com.google.android.gms:estimated_steps"
}

where mintime and maxtime were the values in the request. I'm continuing to read through the docs in the hope that I'm missing something, but no luck currently. Any thoughts?

Community
  • 1
  • 1
mikogk
  • 11
  • 3
  • Make sure your requests are using the correct verb. Could you maybe provide example code of the request execution? – der_michael Aug 25 '15 at 23:15
  • Hey @der_michael, thanks for the response. The request is a get request, but I have just been using OAuth Playground 2.0, part of the Google Developer's console to try and get the data. – mikogk Aug 28 '15 at 19:54
  • try https://www.googleapis.com/fitness/v1/users/me/dataSources/derived:com.google.step_count.delta:com.google.android.gms:merge_step_deltas/datasets/0-1443194884000000000 – Bhavin Chauhan Sep 24 '15 at 09:31

2 Answers2

1

I have been stuck with this request too. You get this response because there is no data within this range of time. Make sure that mintime and maxtime are in nanoseconds and try again. For example, today is: 1442404933000000000 Good luck!

netxu
  • 81
  • 3
0

Use google takeout to export the Google Fitness historic data, then use the time interval for which you have the fitness data. You can only get the data for which you have synced the Google data. So frequently sync google Fit data.

Cinu
  • 11
  • 2