如何在 google fit REST API 中获得心脏积分

How to get Heart points in google fit REST API

我正在尝试从 google fit REST API 中获得心脏分数。我在 google fit 应用程序 (110 bmg) 中看到了心率数据,但我通过 API 获得了空数据。

API: https://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": []
                }
            ]
        },
....
    ]
}

我错过了什么吗?

没关系,我明白了。我想更新 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
}