수면을 기록할 사용자의 식별자(user id)를 생성하며, 이 식별자를 사용해서 사용자의 수면을 지속적으로 관리할 수 있습니다.
기 생성된 사용자의 식별자를 고객의 적절한 저장소에 저장 및 관리하여 지속적으로 사용할 수 있습니다.
POST
https://api.asleep.ai/ai/v1/users
Parameter | Type | Required | Description |
---|
x-api-key | String | O | API Key |
Field | Type | Required | Description |
---|
metadata | Metadata Object or null | X | 사용자 정보 |
Field | Type | Required | Description |
---|
birth_year | Int | X | 출생 도 (1900 년 부터 현재 연도) |
birth_month | Int | X | 출생 월 (1 ~ 12 월) |
birth_day | Int | X | 출생 일 (1 ~ 31 일, 월/윤년에 따라 실제 유효 범위 상이) |
gender | String (male , female , non_binary , other , prefer_not_to_say ) | X | 성별 |
height | Float | X | 키 (0 ~300 cm, 소수점 한자리까지 허용 ) |
weight | Float | X | 체중 (0 ~1000 kg, 소수점 한자리까지 허용) |
curl "https://api.asleep.ai/ai/v1/users" -X POST \
-H "x-api-key: <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"metadata": {
"birth_year": 2001,
"birth_month": 1,
"birth_day": 1,
"gender": "male",
"height": 178.6,
"weight": 62.1
}
}'
Field | Type | Description |
---|
user_id | String | user id |
{
"detail": "success",
"result": {
"user_id": "<USER_ID>"
}
}