Get User
사용자 식별자를 사용해 존재하는 사용자의 정보를 가져올 수 있습니다.
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
- 사용자 정보 획득 성공
 
Body (result field)
| Field | Type | Description | 
|---|---|---|
| user_id | String | user id | 
| to_be_deleted | Boolean | 삭제 대기 여부 | 
| last_session_info | Session Object or null | 마지막 세션 정보 | 
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  | 세션에 업로드한 오디오 데이터의 형태  | 
service  | String  | 세션 생성 시 지정한 서비스 이름  | 
start_time  | String (  | 세션 시작 시각  | 
end_time  | String (  | 세션 종료 시각  | 
state  | String (  | 세션의 상태  | 
complete_time  | String (  | 최종 세션 분석 완료 시각  | 
{
  "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
x-user-id헤더 값이 없거나 포맷이 맞지 않음
{
  "detail": "invalid user id"
}2.3 404 Not Found
- 사용자 없음
 
{
  "detail": "user not exist"
}Updated 5 months ago
