如何从 Jawbone UP API 获取深度睡眠和快速眼动睡眠数据?
How can I get deep and REM sleep data from the Jawbone UP API?
当我点击 sleeps endpoint 时,我没有看到深度睡眠返回任何值。
我发送了这个请求:
https://jawbone.com/nudge/api/v.1.1/users/@me/sleeps?date=20160525
这是我收到的回复:
{u'data': {u'items': [{u'date': 20160525,
u'details': {u'asleep_time': 1464152838,
u'awake': 2284,
u'awake_time': 1464183066,
u'awakenings': 1,
u'body': u'',
u'duration': 30828,
u'light': 14661,
u'mind': 0,
u'quality': u'',
u'rem': 11265,
u'smart_alarm_fire': u'',
u'sound': 2618,
u'sunrise': None,
u'sunset': None,
u'tz': u'America/Los_Angeles'},
u'shared': True,
u'sub_type': 0,
u'time_completed': 1464183066,
u'time_created': 1464152238,
u'time_updated': 1464189792,
u'title': u'for 7h 55m',
u'xid': u'<XID>'}],
u'size': 1},
u'meta': {u'code': 200,
u'message': u'OK',
u'time': 1464219784,
u'user_xid': u'<XID>'}}
深度睡眠的价值在哪里?
此外,当我请求此睡眠的滴答声时:
https://jawbone.com/nudge/api/v.1.1/sleeps//ticks
我收到这样的回复:
{u'data': {u'items': [{u'depth': 1, u'time': 1464152238},
{u'depth': 2, u'time': 1464152838},
{u'depth': 3, u'time': 1464155641},
{u'depth': 3, u'time': 1464156465},
{u'depth': 3, u'time': 1464157134},
{u'depth': 3, u'time': 1464158170},
{u'depth': 3, u'time': 1464159358},
{u'depth': 3, u'time': 1464160060},
{u'depth': 2, u'time': 1464160821},
{u'depth': 3, u'time': 1464161157},
{u'depth': 1, u'time': 1464161492},
{u'depth': 2, u'time': 1464162532},
{u'depth': 3, u'time': 1464162930},
{u'depth': 2, u'time': 1464163656},
{u'depth': 3, u'time': 1464164715},
{u'depth': 2, u'time': 1464165502},
{u'depth': 3, u'time': 1464168230},
{u'depth': 2, u'time': 1464169924},
{u'depth': 3, u'time': 1464170771},
{u'depth': 2, u'time': 1464171134},
{u'depth': 3, u'time': 1464171739},
{u'depth': 2, u'time': 1464172253},
{u'depth': 3, u'time': 1464174025},
{u'depth': 2, u'time': 1464175249},
{u'depth': 3, u'time': 1464176444},
{u'depth': 2, u'time': 1464178035},
{u'depth': 3, u'time': 1464179690},
{u'depth': 1, u'time': 1464181159},
{u'depth': 2, u'time': 1464181803}],
u'size': 29},
u'meta': {u'code': 200,
u'message': u'OK',
u'time': 1464220564,
u'user_xid': u'105utfm8iq4'}}
根据文档,1=清醒,2=浅,3=深,那么REM在哪里?
这里有两个问题。
首先是睡眠端点文档已过时。在睡眠端点的响应中,使用 'sound' 值表示总深度睡眠。在上面的响应中,这将是:
u'sound': 2618,
第二个问题是睡眠节拍目前不区分 deep/sound 睡眠和快速眼动。
我们将在内部审查这些问题并更新 API 的文档和行为。
当我点击 sleeps endpoint 时,我没有看到深度睡眠返回任何值。
我发送了这个请求: https://jawbone.com/nudge/api/v.1.1/users/@me/sleeps?date=20160525
这是我收到的回复:
{u'data': {u'items': [{u'date': 20160525,
u'details': {u'asleep_time': 1464152838,
u'awake': 2284,
u'awake_time': 1464183066,
u'awakenings': 1,
u'body': u'',
u'duration': 30828,
u'light': 14661,
u'mind': 0,
u'quality': u'',
u'rem': 11265,
u'smart_alarm_fire': u'',
u'sound': 2618,
u'sunrise': None,
u'sunset': None,
u'tz': u'America/Los_Angeles'},
u'shared': True,
u'sub_type': 0,
u'time_completed': 1464183066,
u'time_created': 1464152238,
u'time_updated': 1464189792,
u'title': u'for 7h 55m',
u'xid': u'<XID>'}],
u'size': 1},
u'meta': {u'code': 200,
u'message': u'OK',
u'time': 1464219784,
u'user_xid': u'<XID>'}}
深度睡眠的价值在哪里?
此外,当我请求此睡眠的滴答声时: https://jawbone.com/nudge/api/v.1.1/sleeps//ticks
我收到这样的回复:
{u'data': {u'items': [{u'depth': 1, u'time': 1464152238},
{u'depth': 2, u'time': 1464152838},
{u'depth': 3, u'time': 1464155641},
{u'depth': 3, u'time': 1464156465},
{u'depth': 3, u'time': 1464157134},
{u'depth': 3, u'time': 1464158170},
{u'depth': 3, u'time': 1464159358},
{u'depth': 3, u'time': 1464160060},
{u'depth': 2, u'time': 1464160821},
{u'depth': 3, u'time': 1464161157},
{u'depth': 1, u'time': 1464161492},
{u'depth': 2, u'time': 1464162532},
{u'depth': 3, u'time': 1464162930},
{u'depth': 2, u'time': 1464163656},
{u'depth': 3, u'time': 1464164715},
{u'depth': 2, u'time': 1464165502},
{u'depth': 3, u'time': 1464168230},
{u'depth': 2, u'time': 1464169924},
{u'depth': 3, u'time': 1464170771},
{u'depth': 2, u'time': 1464171134},
{u'depth': 3, u'time': 1464171739},
{u'depth': 2, u'time': 1464172253},
{u'depth': 3, u'time': 1464174025},
{u'depth': 2, u'time': 1464175249},
{u'depth': 3, u'time': 1464176444},
{u'depth': 2, u'time': 1464178035},
{u'depth': 3, u'time': 1464179690},
{u'depth': 1, u'time': 1464181159},
{u'depth': 2, u'time': 1464181803}],
u'size': 29},
u'meta': {u'code': 200,
u'message': u'OK',
u'time': 1464220564,
u'user_xid': u'105utfm8iq4'}}
根据文档,1=清醒,2=浅,3=深,那么REM在哪里?
这里有两个问题。
首先是睡眠端点文档已过时。在睡眠端点的响应中,使用 'sound' 值表示总深度睡眠。在上面的响应中,这将是:
u'sound': 2618,
第二个问题是睡眠节拍目前不区分 deep/sound 睡眠和快速眼动。
我们将在内部审查这些问题并更新 API 的文档和行为。