【发布时间】:2022-02-17 12:13:34
【问题描述】:
注意:
startTime 和 endTime 以纳秒为单位。
问题: 我有大量睡眠数据,但 API 只是返回一个空的健康记录数组。请告诉我问题是什么。我可以从哪里获得这些步骤。健康记录部分没有步骤。
【问题讨论】:
标签: huawei-mobile-services huawei-developers
注意:
startTime 和 endTime 以纳秒为单位。
问题: 我有大量睡眠数据,但 API 只是返回一个空的健康记录数组。请告诉我问题是什么。我可以从哪里获得这些步骤。健康记录部分没有步骤。
【问题讨论】:
标签: huawei-mobile-services huawei-developers
QUESTION 1 - “I have plenty of sleep data but the API is just returning an empty health Records array"
SOLUTION:
Please refer the below link for “Querying Health Records in a Specified Period”
https://developer.huawei.com/consumer/en/doc/development/HMSCore-References/get-health-record-by-datatype-0000001142843917#section9701181322219
Use the valid parameters like starttime, endtime in above API and apply the required “Health Record Data Types”. The public data types are listed in the below link.
https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides/public-dt-0000001050069714#section147711038114919
There are different types like continuous, instantaneous, total, delta or statistics, you can pick as per your requirement referring to above link
Possible datatypes you asked (not exact) -
steps, - com.huawei.continuous.steps.total
sleep, - com.huawei.continuous.sleep.fragment
heart rate - com.huawei.instantaneous.heart_rate
calories data - com.huawei.continuous.calories.burnt
QUESTION 2 - “Authorization Url issue”
SOLUTION :
It is due to the network restrictions in your work location
Please check you network restrictions. Please removing the proxy and try it in open network.
【讨论】: