如何在Google Fit REST API中获得心脏积分

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

我正在尝试从Google Fit REST API中获得重点。我在Google Fit应用中看到了心率数据(110 bmg),但是我正在通过API获取空数据。

APIhttps://www.googleapis.com/fitness/v1/users/me/dataset:aggregate

BODY

{
  "aggregateBy": [{
    "dataTypeName": "com.google.heart_rate.bpm",
    "dataSourceId": "derived:com.google.heart_minutes:com.google.android.gms:merge_heart_minutes"
  }],
  "bucketByTime": { "durationMillis": 86400000 },
  "startTimeMillis": 1580533200000, // feb 01 2020
  "endTimeMillis": 1582866000000 // feb 28 2020
}

结果:

我正在获得空记录,例如:

{
    "bucket": [ 
....
{
            "startTimeMillis": "1580619600000",
            "endTimeMillis": "1580706000000",
            "dataset": [
                {
                    "dataSourceId": "derived:com.google.heart_minutes.summary:com.google.android.gms:aggregated",
                    "point": []
                }
            ]
        },
....
    ]
}

我想念什么吗?

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

[没关系,我明白了。我猜花了一些时间来更新API,我不得不更新主体:

{
  "aggregateBy": [{
    "dataTypeName": "com.google.heart_minutes"
    //"dataSourceId": "derived:com.google.heart_minutes:com.google.android.gms:merge_heart_minutes"
  }],
  "bucketByTime": { "durationMillis": 86400000 },
  "startTimeMillis": 1580533200000, // feb 01 2019
  "endTimeMillis": 1580878800000 // feb 6 2020 1582866000000 // feb 28 2020
}
© www.soinside.com 2019 - 2024. All rights reserved.