Extracting aggregate data and other data from the google-fit REST API

无人久伴 提交于 2019-12-12 02:45:49

问题


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?


回答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!



来源:https://stackoverflow.com/questions/32215517/extracting-aggregate-data-and-other-data-from-the-google-fit-rest-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!