Get User
You can retrieve information about an existing user using the user identifier.
1. Request
1.1 URL
GET
https://api.asleep.ai/ai/v1/users/{user_id}
1.2 Header
Field | Type | Required | Description |
---|---|---|---|
x-api-key | String | O | API Key |
1.3 Path Parameter
Field | Type | Required | Description |
---|---|---|---|
user_id | String | O | user id |
Example
curl "https://api.asleep.ai/ai/v1/users/{user_id}" -XGET \
-H "x-api-key: <YOUR_API_KEY>"
2. Response
2.1 200 OK
- Successful retrieval of user information
Body (result field)
Field | Type | Description |
---|---|---|
user_id | String | user id |
to_be_deleted | Boolean | Whether to be deleted |
last_session_info | Session Object or null | Last session information |
Session Object
if state == OPEN
: session_end_time은 null
if state != COMPLETE
: complete_end_time은null
Field | Type | Description |
---|---|---|
session_id | String | session id |
inference_type | String | Format of the uploaded audio data in the session |
service | String | Service name specified when creating the session |
start_time | String (YYYY-MM-DDThh:mm:ssZ ) | Start time of the session |
end_time | String (YYYY-MM-DDThh:mm:ssZ )? | End time of the session |
state | String (OPEN ,CLOSED ,COMPLETE ) | State of the session |
complete_time | String (YYYY-MM-DDThh:mm:ssZ )? | Session analysis completion timeif state != COMPLETE this value is null |
{
"detail": "success",
"result": {
"user_id": "<USER_ID>",
"to_be_deleted": false,
"last_session_info": {
"session_id": "20230630224117",
"inference_type": "MELSPECTROGRAM",
"service": "NOSERVICE",
"start_time": "2023-06-30T22:41:17",
"end_time": "2023-07-01T05:36:12",
"state": "COMPLETE",
"complete_time": "2023-07-01T05:41:12"
}
}
}
2.2 401 Unauthorized
- The
x-user-id
header value is missing or in the wrong format
{
"detail": "invalid user id"
}
2.3 404 Not Found
- User does not exist
{
"detail": "user not exist"
}
Updated about 1 year ago