Android Fitness REST API缺少数据点

问题描述 投票:1回答:1

这是我在做什么:我在手机上安装了Google Fit应用并收集了一些健身数据:screenshot from the app

然后我问到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个数据集,每个数据集一个。期望值如下:

  • 1月12日:0
  • 1月13日:0
  • 1月14日:1688年
  • [1th 15th:1934
  • [1月16日:844
  • 1月17日:0
  • [1月18日:857

我实际上得到的是:

除了第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次?

((我也不能强迫这些代码块正确格式化,对此表示歉意)

google-api google-fit
1个回答
0
投票

输入当前日期和时间2019年11月1日:1572586200,因此“ startTimeMillis”:“ 1572586200000”2019年11月8日:1573191000,因此“ endTimeMillis”:“ 1573191000000”

© www.soinside.com 2019 - 2024. All rights reserved.