[GET] Get User
사용자 식별자를 사용해 존재하는 사용자의 정보를 가져올 수 있습니다.
Request
URL
GET
https://api.asleep.ai/ai/v1/users/{user_id}
Header
Field | Type | Required | Description |
---|---|---|---|
x-api-key | String | O | API Key |
Path Parameter
Field | Type | Required | Description |
---|---|---|---|
user_id | String | O | user id |
Example
curl "https://api.asleep.ai/ai/v1/users/{user_id}" -X GET \
-H "x-api-key: <YOUR_API_KEY>"
Response
200 OK
- 사용자 정보 획득 성공
Body (result field)
Field | Type | Description |
---|---|---|
user_id | String | user id |
to_be_deleted | Boolean | 삭제 대기 여부 |
last_session_info | Session Object or null | 마지막 세션 정보 |
metadata | Metadata 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 ( | 최종 세션 분석 완료 시각
|
Metadata Object
Field | Type | Description |
---|---|---|
birth_year | Int? | 출생 연도 (1900 년 부터 현재 연도) |
birth_month | Int? | 출생 달 (1 ~ 12 월) |
birth_day | Int? | 출생 일 (1 ~ 31 일, 월/윤년에 따라 실제 유효 범위 상이) |
gender | String (male , female , non_binary , other , prefer_not_to_say )? | 성별 |
height | Float? | 키 (0 ~ 300 cm, 소수점 한자리까지 허용) |
weight | Float? | 체중 (0 ~ 1000 kg, 소수점 한자리까지 허용) |
{
"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"
},
"metadata": {
"birth_year": 2001,
"birth_month": 1,
"birth_day": 1,
"gender": "male",
"height": 178.6,
"weight": 62.1
}
}
401 Unauthorized
x-user-id
헤더 값이 없거나 포맷이 맞지 않음
{
"detail": "invalid user id"
}
404 Not Found
- 사용자 없음
{
"detail": "user not exist"
}
Updated 4 days ago