如何从Jawbone UP API获取深度和REM睡眠数据?

时间:2016-05-26 00:48:43

标签: jawbone

当我点击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在哪里?

1 个答案:

答案 0 :(得分:0)

这里有两个问题。

首先,sleeps端点文档已过期。在睡眠终点的响应中,使用“声音”值进行总深度睡眠。在上面的回答中,这将是:

u'sound': 2618,

第二个问题是睡眠时间点目前不区分深度/声音睡眠和REM。

我们将在内部审核这些问题,并更新文档和API的行为。