这是我在做什么:我在手机上安装了Google Fit应用并收集了一些健身数据:
然后我问到OAuth 2.0 Playground,并尝试通过REST请求读取该数据:
方法:开机自检URI:https://www.googleapis.com/fitness/v1/users/me/dataset:aggregate身体:
{
"aggregateBy": [{
"dataTypeName": "com.google.calories",
"dataSourceId": "derived:com.google.calories.bmr:com.google.android.gms:merged"
}],
"bucketByTime": { "durationMillis": 86400000 },
"startTimeMillis": 1547232519000,
"endTimeMillis": 1547837319000
}
我期望得到的是:接下来7天的7个数据集,每个数据集一个。期望值如下:
我实际上得到的是:
除了第14天以外的所有时间(当然,开始和结束时间有所不同:
{
"startTimeMillis": "1547578119000",
"endTimeMillis": "1547664519000",
"dataset": [
{
"dataSourceId":"derived:com.google.calories.bmr.summary:com.google.android.gms:aggregated",
"point": []
}
]
},
[1月14日:
{
"startTimeMillis": "1547491719000",
"endTimeMillis": "1547578119000",
"dataset": [
{
"dataSourceId": "derived:com.google.calories.bmr.summary:com.google.android.gms:aggregated",
"point": [
{
"startTimeNanos": "1547500395267000000",
"originDataSourceId": "derived:com.google.calories.bmr:com.google.android.gms:from_height&weight",
"endTimeNanos": "1547500402445000000",
"value": [
{
"mapVal": [],
"fpVal": 1688.25
},
{
"mapVal": [],
"fpVal": 1688.25
},
{
"mapVal": [],
"fpVal": 1688.25
}
],
"dataTypeName": "com.google.calories.bmr.summary"
}
]
}
]
},
有人知道为什么我没有为大多数括号获得任何价值,而我却为其中一个获得了价值吗?为什么第14个值列出3次?
((我也不能强迫这些代码块正确格式化,对此表示歉意)
输入当前日期和时间2019年11月1日:1572586200,因此“ startTimeMillis”:“ 1572586200000”2019年11月8日:1573191000,因此“ endTimeMillis”:“ 1573191000000”