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 (INFERENCE_COMPLETE ,SESSION_COMPLETE ) | Callback event typeINFERENCE_COMPLETE : If the analysis is completed within 5 or 20 minute incrementsSESSION_COMPLETE : The entire session analysis is complete |
callback_version | String ( V1 ,V2 ) | Callback versionV1 : Follows the callback format of v1.0 documentationV2 :: Follows the callback format of the current version |
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 e.g.) when uploading MELSPECTROGRAM, if seq_num 39, inference_seq_num is 3 |
stage_list | [Int] | Sleep stage results in previous 20 minutes frame e.g.) if inference_seq_num is 6, you get back 40 values from 3 to 6 |
breath_stages | [Int] | Breathing stability stage results in previous 20 minutes frame e.g.) if inference_seq_num is 6, you get back 40 values from 3 to 6 |
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
The data will be delivered in the same format as the "result" field of the Get Single Session.
Updated about 1 year ago