유저 데이터 연동하기
유저 데이터를 서버에서 연동하는 방법을 설명합니다. 블럭스 담당자에게 문의하여 발급받은 secret key를 사용해서 유저 데이터를 연동할 수 있습니다.
유저 생성 및 속성 업데이트 API
엔드포인트
POST https://api.blux.ai/prod/v2/applications/{APPLICATION_ID}/users/update-properties/bulk
인증
요청 시 Authorization 헤더에 발급받은 secret key를 포함해야 합니다:
Authorization: {SECRET_KEY}
요청 본문
{
"users": [
{
"user_id": "USER_ID",
"user_properties": {
"phone_number": "01012345678",
"email_address": "john.doe@example.com",
"nighttime_notification_consent": true,
"marketing_notification_consent": true,
"marketing_notification_sms_consent": true,
"marketing_notification_email_consent": true,
"marketing_notification_kakao_consent": true,
"marketing_notification_push_consent": true
},
"custom_user_properties": {
"name": "John Doe",
"age": 30
}
},
...
]
}
필드 설명
| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
users | Array<object> | 필수 | 유저 데이터 목록 |
↳ user_id | string | 필수 | 유저 고유 ID |
↳ user_properties | object | 선택 | 유저 속성 데이터 |
• phone_number | string | 선택 | 전화번호 |
• email_address | string | 선택 | 이메일 주소 |
• nighttime_notification_consent | boolean | 선택 | 야간 수신 동의 여부 |
• marketing_notification_consent | boolean | 선택 | 전체 마케팅 수신 동의 여부 |
• marketing_notification_sms_consent | boolean | 선택 | 마케팅 문자 수신 동의 여부 |
• marketing_notification_email_consent | boolean | 선택 | 마케팅 이메일 수신 동의 여부 |
• marketing_notification_kakao_consent | boolean | 선택 | 마케팅 카카오톡 수신 동의 여부 |
• marketing_notification_push_consent | boolean | 선택 | 마케팅 푸시 수신 동의 여부 |
↳ custom_user_properties | object | 선택 | 커스텀 유저 속성 데이터 |
제한 사항
- 한 요청당 최대 users 수: 100개
- 권장 요청 속도: 초당 최대 20건
상태 코드
| 코드 | 설명 |
|---|---|
200 OK | 요청이 정상적으로 수락되어 유저 속성 데이터가 업데이트됨 |
400 Bad Request | 필수 필드 누락, 잘못된 값 전달 시 |
401 Unauthorized | 인증 실패 (secret key 오류) |
500 Internal Server Error | 서버 내부 오류 |
테스트 예시
curl -X POST https://api.blux.ai/prod/v2/applications/abcd1234/users/update-properties/bulk \
-H "Authorization: xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"users": [
{
"user_id": "blux-test",
"user_properties": {
"phone_number": "01012345678",
"email_address": "john.doe@example.com",
"nighttime_notification_consent": true,
"marketing_notification_consent": true,
"marketing_notification_sms_consent": true,
"marketing_notification_email_consent": true,
"marketing_notification_kakao_consent": true,
"marketing_notification_push_consent": true
},
"custom_user_properties": {
"name": "John Doe",
"age": 30
}
},
...
]
}'
200 OK를 반환하면 유저 데이터가 성공적으로 업데이트되었음을 의미합니다.
유저 삭제 API
엔드포인트
POST https://api.blux.ai/prod/v2/applications/{APPLICATION_ID}/users/delete/bulk
인증
요청 시 Authorization 헤더에 발급받은 secret key를 포함해야 합니다:
Authorization: {SECRET_KEY}
요청 본문
{
"user_ids": ["id1", "id2", "id3"]
}
필드 설명
| 필드 | 타입 | 필수 | 설명 |
|---|---|---|---|
user_ids | Array<string> | 필수 | 삭제할 유저 ID 목록 (⚠️ SDK에서 signIn 메서드 호출 시 전달하는 유저 식별자와 동일한 식별 체계여야 합니다.) |
제한 사항
- 한 요청당 최대 처리 가능 유저 수: 3000명
- 허용 요청 속도: 초당 최대 100건
상태 코드
| 코드 | 설명 |
|---|---|
200 OK | 요청이 정상적으로 수락되어 유저가 삭제됨 |
400 Bad Request | 필수 필드 누락, 잘못된 값 전달 시 |
401 Unauthorized | 인증 실패 (secret key 오류) |
500 Internal Server Error | 서버 내부 오류 |
테스트 예시
curl -X POST https://api.blux.ai/prod/v2/applications/abcd1234/users/delete/bulk \
-H "Authorization: xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"user_ids": ["id1", "id2", "id3"]
}'
추가 문의는 블럭스 기술지원팀에 연락주세요.