Dashboard Sign InKR

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

FieldTypeDescription
x-api-keyStringAPI key used to upload data or end session
x-user-idStringThe user id that created the sleep session

1.3 Body

Field

Type

Description

callback_event

String (INFERENCE_COMPLETE,SESSION_COMPLETE)

Callback event type
INFERENCE_COMPLETE: If the analysis is completed within 5 or 20 minute increments
SESSION_COMPLETE: The entire session analysis is complete

callback_version

String
(V1,V2)

Callback version
V1: Follows the callback format of v1.0 documentation
V2:: 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

FieldTypeDescription
user_idStringuser id
session_idStringsession id
sleep_dataSleep Data ObjectFull 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.