网站建设可信赖,北京朝阳区一小区现疑似病例,菏泽网站建设兼职,怎么做网站需要多少钱本文介绍睡眠带相关接口。
API 列表
请求方法API描述GET/v1.0/devices/{device_id}/sleep/daily-reports获取日睡眠报告。GET/v1.0/devices/{device_id}/sleep/monthly-reports获取月睡眠报告。GET/v1.0/devices/{device_id}/sleep/24h-reports获取 24 小时睡眠报告。GET/v1.…本文介绍睡眠带相关接口。
API 列表
请求方法API描述GET/v1.0/devices/{device_id}/sleep/daily-reports获取日睡眠报告。GET/v1.0/devices/{device_id}/sleep/monthly-reports获取月睡眠报告。GET/v1.0/devices/{device_id}/sleep/24h-reports获取 24 小时睡眠报告。GET/v1.0/devices/{device_id}/sleep/preview/reports预览睡眠报告状态。PUT/v1.0/devices/{device_id}/sleep/reports/{report_id}更新报告状态。
获取日睡眠报告
功能描述
获取日睡眠报告。
接口地址
GET /v1.0/devices/{device_id}/sleep/daily-reports请求参数
参数名类型参数类型说明必填device_idStringURI设备 ID。是report_timeLongURL获取设备所在时区报告的时间戳精确到秒。是
返回参数
参数名参数类型描述successBoolean是否成功 true成功false失败statusString状态tLong13 位标准时间戳resultList返回结果
Result
参数名参数类型描述reportsList睡眠报告
Reports
参数名参数类型描述report_idLong报告 ID。data_dateLong报告时间精确到秒。start_timeLong睡眠起始时间精确到秒。durationInt睡觉总时长单位秒。wakeInt清醒总时间单位秒。out_of_bed_durationInt离床时长单位秒。sleep_statusInt睡眠状态 0设备未连接1不在床2清醒3睡着avg_breath_rateInt平均呼吸率。avg_heart_rateInt平均心率。snore_numberInt鼾声次数。snore_durationInt鼾声总时长。snore_high_proportionInt鼾声程度为高的比例。snore_mid_proportionInt鼾声程度为中的比例。snore_low_proportionInt鼾声程度为低的比例。snore_non_proportionInt鼾声程度为无的比例。
请求示例
GET /v1.0/devices/vedeo887723I****/sleep/daily-reports?report_time1594887507返回示例
{result: {reports: [{avg_breath_rate: 15,avg_heart_rate: 56,data_date: 1596577259,duration: 238,out_of_bed_duration: 528,start_time: 1596477259,wake: 205}]},success: true,t: 1597115614003
}错误码
以下为该接口常见的业务异常更多的异常错误参见全局错误码。
错误码说明500系统错误
获取月睡眠报告
功能描述
获取月睡眠报告。
接口地址
GET /v1.0/devices/{device_id}/sleep/monthly-reports请求参数
参数名类型参数类型说明必填device_idStringURI设备 ID。是report_timeLongURL获取设备所在时区报告的时间戳精确到秒。是
返回参数
参数名参数类型描述successBoolean是否成功 true成功false失败statusString状态tLong13 位标准时间戳resultList返回结果
Result
参数名参数类型描述reportsList睡眠报告
Reports
参数名参数类型描述reportIdString报告 ID。timeInteger时间。posInteger周或月在指定年份的位置。例如周接口中指定pos: 8, 表示 2020 年的第 8 周。yearInteger报告的年份。daysInteger记录的天数scoreInt平均分数。scoreValueInt[]分数列表。avg_sleep_timeInt平均睡眠时长单位秒。avg_fallasleep_timeInt平均入睡时长单位秒。sleep_time_valueInt[]实际睡眠时长列表单位秒。fallasleep_time_valueInt[]入睡时长列表单位秒。avg_sleep_percentageInt平均睡眠效率。avg_deepsleep_percentageInt平均深睡比例。sleep_percentage_valueInt[]睡眠效率列表。deepsleep_percentage_valueInt[]深睡比例列表。sleep_rule_statusInt睡眠规律 0规律1不规律start_sleep_valueList开始睡觉时间列表。wakeup_valueList清醒时间列表。avg_breath_rateInt平均呼吸率。breath_rate_valueInt[]呼吸率列表。avg_heart_rateInt平均心率。heart_rate_valueInt[]心率列表。avg_inbed_timeInt平均赖床时长单位秒。inbed_time_valueInt[]赖床时长列表单位秒。avgawake_timesInt平均清醒次数。awake_times_valueInt[]清醒次数列表。avg_outofbed_timesInt起床次数。outofbed_times_cntInt离床次数。outofbed_times_valueInt[]起床次数列表。factorsString周月状态值 0没有1有score_percString分数占比状态 0完美睡觉占比1优秀睡觉占比2一般睡觉占比3睡觉差劲占比4没有睡觉记录占比sleep_hour_more9daysInt睡眠时长超过 9 个小时的天数。sleep_hour_less6daysInt睡眠时长少于 6 个小时的天数。heartbeat_pause_daysInt心跳过缓天数。apnea_daysInt呼吸过缓天数。avgSnore_timeInt平均鼾声时长。snore_time_valueInt[]鼾声时长列表。
请求示例
GET /v1.0/devices/vedeo74882653500291/sleep/monthly-reports?report_time1594887507返回参数
{result: {reports: [{apnea_days: 4,avg_breath_rate: 15,avg_deepsleep_percentage: 14,avg_fallasleep_time: 24,avg_heart_rate: 57,avg_inbed_time: 55,avg_outofbed_times: 5,avg_sleep_percentage: 54,avg_sleep_time: 297,avg_snore_time: 0,avgawake_times: 5,awake_times_value: [3,2,2,9,0,10,11,-1,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],breath_rate_value: [15,15,15,15,15,15,15,-1,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],days: 8,deepsleep_percentage_value: [6,11,0,21,46,0,3,-1,23,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],factors: 1,1,1,0,0,fallasleep_time_value: [37,5,58,5,5,57,10,-1,15,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],heart_rate_value: [56,56,56,59,60,57,59,-1,56,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],heartbeat_pause_days: 0,inbed_time_value: [125,42,125,49,4,11,59,-1,22,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],outofbed_times_cnt: 7,outofbed_times_value: [2,1,2,9,0,9,10,-1,4,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],pos: 8,score: 48,score_perc: 0,0,6,19,75,score_value: [54,48,34,61,36,32,45,-1,74,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],sleep_hour_less6days: 8,sleep_hour_more9days: 1,sleep_percentage_value: [34,85,13,58,98,38,40,-1,67,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],sleep_rule_status: 1,sleep_time_value: [133,377,55,283,666,296,238,-1,328,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],snore_time_value: [-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1],start_sleep_value: [00:04,23:43,01:54,00:29,00:07,23:54,23:40,,23:43,,,,,,,,,,,,,,,,,,,,,,],time: 1596211200,wakeup_value: [04:59,06:47,05:52,06:06,11:22,05:58,04:47,,05:48,,,,,,,,,,,,,,,,,,,,,,],year: 2020}]},success: true,t: 1597073472399
}错误码
以下为该接口常见的业务异常更多的异常错误参见全局错误码。
错误码说明500系统错误
获取 24 小时睡眠报告
功能描述
获取 24 小时睡眠报告。
接口地址
GET /v1.0/devices/{device_id}/sleep/24h-reports请求参数
参数名类型参数类型说明必填device_idStringURI设备 ID。是report_timeLongURL获取设备所在时区报告的时间戳精确到秒。是
返回参数
参数名参数类型描述successBoolean是否成功 true成功false失败statusString状态tLong13 位标准时间戳resultList返回结果
result 说明
参数名参数类型描述report_idLong报告 IDstart_timeLong睡眠起始时间durationInt睡觉总时长wakeInt清醒总时间out_of_bed_durationInt离床时长sleep_statusInt[]睡眠状态avg_breath_rateInt平均呼吸率avg_heart_rateInt平均心率snore_numberInt鼾声次数snore_durationInt鼾声总时长snore_high_proportionInt鼾声程度为高的比例snore_mid_proportionInt鼾声程度为中的比例snore_low_proportionInt鼾声程度为低的比例snore_non_proportionInt鼾声程度为无的比例
请求示例
GET /v1.0/devices/vedeo8877237278/sleep/24h-reports?report_time1594887507返回示例
{result: {reports: [{avg_breath_rate: 15,avg_heart_rate: 56,duration: 238,out_of_bed_duration: 528,start_time: 1596477259,wake: 205}]},success: true,t: 1597115614003
}错误码
以下为该接口常见的业务异常更多的异常错误请参见全局错误码。
错误码说明500系统错误
预览睡眠报告状态
功能描述
预览睡眠报告状态。
接口地址
GET /v1.0/devices/{device_id}/sleep/preview/reports请求参数
参数名类型参数类型说明必填device_idStringURI设备 ID。是start_timeLongURL设备所在时区开始时间的时间戳精确到秒。是end_timeLongURL设备所在时区结束时间的时间戳精确到秒。是
返回参数
参数名参数类型描述successBoolean是否成功 true成功false失败statusString状态tLong13 位标准时间戳resultList返回结果
Result
参数名参数类型描述report_idString报告 ID。data_dateString查询时间格式为yyyy-MM-dd。read_stateBoolean是否已读 true已读false未读
请求示例
GET /v1.0/devices/vedeo53424223/sleep/preview/reportsstart_time1590984264end_time1593489864返回示例
{result:[{data_date: 2020-08-03,read_state: true,report_id: 1355686}],t:1594979100693,success:true,status:ok
}错误码
以下为该接口常见的业务异常更多的异常错误请参见全局错误码。
错误码说明500系统错误
更新报告状态
功能描述
更新报告读取状态。
接口地址
PUT /v1.0/devices/{device_id}/sleep/reports/{report_id}请求参数
参数名类型参数类型说明必填device_idStringURI设备 ID是report_idLongURL报告 ID是
返回参数
参数名类型说明codeInteger错误码。successBoolean是否成功 true成功false失败msgString请求失败的信息成功为空。resultBoolean返回结果。
请求示例
PUT /v1.0/devices/vedeo623232/sleep/reports/10002返回示例 { result:true, t:1542776517323 }
错误码
以下为该接口常见的业务异常更多的异常错误请参见全局错误码。
错误码说明500系统错误