【问题标题】:HMS Health Record Sleep API returning empty HealthRecords arrayHMS 健康记录睡眠 API 返回空的 HealthRecords 数组
【发布时间】:2022-02-17 12:13:34
【问题描述】:

我正在调用这个 API https://health-api.cloud.huawei.com/healthkit/v1/healthRecords?startTime=1633700548000000000&endTime=1636378903389000000&dataType=com.huawei.health.record.sleep&subDataType=com.huawei.continuous.sleep.fragment

注意:

startTime 和 endTime 以纳秒为单位。

问题: 我有大量睡眠数据,但 API 只是返回一个空的健康记录数组。请告诉我问题是什么。我可以从哪里获得这些步骤。健康记录部分没有步骤。

【问题讨论】:

    标签: huawei-mobile-services huawei-developers


    【解决方案1】:
    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.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-01
      • 2017-09-29
      • 2013-01-26
      • 1970-01-01
      • 1970-01-01
      • 2015-11-28
      • 2022-01-15
      • 2015-08-24
      相关资源
      最近更新 更多