Callback
Function that delivers the analyzed results by calling the desired HTTP callback URL, if the parameter is entered in the upload and session end API at Session API, the analysis results will be delivered in the following format
1. Request
1.1 Method
POST
1.2 Header
Field | Type | Description |
---|---|---|
x-api-key | String | API key used to upload data or end session |
x-user-id | String | The user id that created the sleep session |
1.3 Body
Field | Type | Description |
---|---|---|
callback_event | String ( | Callback event type |
callback_data | Callback Data Object | Callback data |
1.3.1 Callback Data Object in case of INFERENCE_COMPLETE
Field | Type | Description |
---|---|---|
user_id | String | user id |
session_id | String | session id |
seq_num | Int | Order number of the audio data uploaded |
inference_seq_num | Int | Number that converted seq_num into 5 minutes increments |
stage_list | [Int] | Sleep stage results in previous 20 minutes frame |
osa_stage_list | [Int] | Sleep apnea stage results in previous 20 minutes frame |
1.3.2 Callback Data Object in case of SESSION_COMPLETE
Field | Type | Description |
---|---|---|
user_id | String | user id |
session_id | String | session id |
sleep_data | Sleep Data Object | Full Sleep Analysis Results |
1.3.3 Sleep Data Object
For a more detailed description of metrics, see Get Single Session. The nullable of the object and the internal components of objects are determined depending on the session status and the terms of the agreement.
- when
if state == COMPLETE
if 2-stage sleep analysis is used
: there only is 'wake' and 'sleep' stages, so time_in_rem, time_in_light, time_in_deep, rem_ratio, light_ratio, deep_ratio value will return nullif sleep apnea feature is not used
: this feature will not be supported so, time_in_stable_breath, time_in_unstable_breath, stable_breath_ratio, unstable_breath_ratio, breathing_pattern, estimated_ahi value will return nullif all stages are 'wake'(never slept session)
: the user have not slept so, sleep_latency, sleep_time, wakeup_latency, wake_time, wake_ratio, sleep_ratio, rem_ratio, light_ratio, deep_ratio, stable_breath_ratio, unstable_breath_ratio, breathing_pattern, estimated_ahi will all return nullINVALID session (lasting less than 20 minutes or unanalyzable session)
: all nullable field values as null
Field | Type | Description |
---|---|---|
session_id | String | session id |
state | String ( | Session status |
session_start_time | String ( | When sleep measurement began |
session_end_time | String ( | When the sleep measurement ended |
sleep_stages | [Sleep Stages] | List of sleep stages |
osa_stages | [OSA Stages] | List of sleep apnea stages |
sleep_efficiency | float ( | The percentage of time you actually slept during sleep measurement |
sleep_latency | int ( | The time it takes to fall asleep after the start of sleep measurement |
sleep_time | String ( | The time you started falling asleep |
wakeup_latency | int ( | The time it takes to wake up and end your sleep measurement |
wake_time | String ( | The time you woke up |
time_in_wake | int ( | Time woken up in the middle of sleep |
time_in_sleep_period | int ( | During sleep measurement time, excluding the time it took from the start of the sleep measurement to fall asleep and the time it took from the wake to the end of the sleep measurement |
time_in_sleep | int ( | During sleep measurement time, the time you were actually sleeping is divided into three stages: deep, light, and rem |
time_in_bed | int ( | The time from the start of the sleep measurement to the end of the sleep measurement |
time_in_rem | int ( | Total time the sleep stage progressed to REM |
time_in_light | int ( | Total time the sleep stage progressed to Light |
time_in_deep | int ( | Total time the sleep stage progressed to Deep |
time_in_stable_breath | int ( | Total time in the breathing stable section |
time_in_unstable_breath | int ( | Total time of breath instability |
wake_ratio | float ( | Rate of wake in the middle during sleep stage |
sleep_ratio | float ( | The percentage of time you sleep without waking up during the sleep stage |
rem_ratio | float ( | Rate of REM sleep during sleep stage |
light_ratio | float ( | Rate of Light sleep during sleep stage |
deep_ratio | float ( | Rate of deep sleep during sleep stage |
stable_breath_ratio | float ( | The percentage of time that was a breathing stable section during the sleep stage |
unstable_breath_ratio | float ( | The percentage of time during the sleep stage that there was a breathing instability section |
breathing_pattern | String ( | Stages of respiratory instability
|
estimated_ahi | float ( | Values for determining respiratory instability levels |
Updated 17 days ago