synopsis: | Example code to demonstrate how to “GET” JSON data from Jawbone UP API |
---|
To compile this example code, run the command: python get_sleep_data.py user_email user_password https://jawbone.com/nudge/api/users/@me/sleeps? &
returns: | security token |
---|
returns: | user xid, event xid, date, sleep time, awake time, number of awakenings, duration of sleep event, quality score, etc. |
---|
Operate on JSON data dictionary and use JSON.dumps to print in readable format
Convert timestamps into a readable format with access_jawbone.format() function
returns: | 'xid' for each sleep event |
---|
Operate on the list of sleep events ‘xid’ obtained in EXAMPLE_1
Insert sleep event xid[item] into detailed data request url 'https://jawbone.com/nudge/api/sleeps/' + xid[item] + '/ticks'
returns: | timing of sleep phases (1=awake, 2=light sleep, 3=sound sleep) |
---|