API 참조
참가 내역
콘테스트 참가 내역 생성, 조회, 수정 및 관리
참가 내역
콘테스트 참가자와 참가 내역을 관리합니다.
참가 내역 목록 조회
/api/v1/contests/:contestId/entries특정 콘테스트의 참가 내역 목록을 페이지 단위로 반환합니다.
경로 매개변수
contestIdstring required 고유 콘테스트 식별자
쿼리 매개변수
pagenumber optional 1부터 시작하는 페이지 번호. 기본값: 1
limitnumber optional 페이지당 참가 내역 수 (1-100). 기본값: 20
searchstring optional 이메일 또는 이름으로 검색 (대소문자 구분 없음)
요청
curl -X GET "https://blitzrocket.com/api/v1/contests/clx1abc123/entries?page=1&limit=10" \
-H "x-api-key: your_api_key_here"
응답
{
"success": true,
"data": [
{
"id": "entry_abc123",
"email": "jane@example.com",
"name": "Jane Doe",
"phone": null,
"points": 150,
"emailConfirmed": true,
"disqualified": false,
"referralCode": "REF-XYZ789",
"createdAt": "2025-06-15T10:30:00.000Z"
},
{
"id": "entry_def456",
"email": "john@example.com",
"name": "John Smith",
"phone": "+1234567890",
"points": 85,
"emailConfirmed": true,
"disqualified": false,
"referralCode": "REF-ABC456",
"createdAt": "2025-06-16T14:20:00.000Z"
}
],
"pagination": {
"page": 1,
"limit": 10,
"total": 1523,
"totalPages": 153
}
}
응답 필드
idstring참가 내역 고유 식별자
emailstring참가자의 이메일 주소
namestring | null참가자의 이름
phonestring | null참가자의 전화번호
pointsnumber획득한 총 포인트
emailConfirmedboolean이메일 확인 여부
disqualifiedboolean참가 자격 박탈 여부
referralCodestring | null이 참가 내역의 고유 추천 코드
createdAtstring참가 내역이 생성된 시각 (ISO 8601 타임스탬프)
참가 내역 상세 조회
/api/v1/entries/:entryId특정 참가 내역에 대한 상세 정보를 조회합니다.
경로 매개변수
entryIdstring required 고유 참가 내역 식별자
요청
curl -X GET https://blitzrocket.com/api/v1/entries/entry_abc123 \
-H "x-api-key: your_api_key_here"
응답
{
"success": true,
"data": {
"id": "entry_abc123",
"email": "jane@example.com",
"name": "Jane Doe",
"phone": null,
"points": 150,
"pointsUsed": 25,
"emailConfirmed": true,
"disqualified": false,
"referralCode": "REF-XYZ789",
"contestId": "clx1abc123def456",
"contestTitle": "Summer Giveaway 2025",
"referralsCount": 3,
"bonusActionsCompleted": 5,
"totalPurchaseValue": 129.99,
"totalPurchaseCount": 2,
"createdAt": "2025-06-15T10:30:00.000Z"
}
}
이메일로 참가 내역 찾기
/api/v1/widget/:contestId/lookup-entry참가자의 이메일로 확인된 참가 내역을 찾아, 서버에서 data-entry-id로 임베드 위젯에 해당 참가자의 페이지를 열 수 있게 합니다. 참가 내역 ID만 있으면 그 참가자의 페이지가 열리므로 반드시 서버에서만 호출하고, 이 조회 기능이나 비공개 키를 브라우저에 절대 노출하지 마세요.
쿼리 매개변수
emailstring required 참가자의 이메일 (대소문자 구분 없음)
요청
curl "https://blitzrocket.com/api/v1/widget/clx_contest_123/lookup-entry?email=jane%40example.com" \
-H "x-api-key: your_private_key_here"
응답
{ "found": true, "entryId": "clx_entry_456" }
해당 이메일로 확인된 참가 내역이 없으면 { "found": false }를 반환합니다. 이 경우에는 이메일로 위젯을 렌더링하세요(<div id="blitzrocket-widget" data-email="...">). 참가자가 이메일로 받은 코드로 확인하면 페이지가 열립니다.
참가 내역 생성
/api/v1/contests/:contestId/entries콘테스트에 새 참가 내역을 생성합니다. 비공개 API 키가 필요합니다.
경로 매개변수
contestIdstring required 고유 콘테스트 식별자
요청 본문
emailstring optional 참가자의 이메일 주소입니다. 이메일 또는 전화번호 중 하나는 필수입니다.
phonestring optional 참가자의 전화번호입니다. 이메일 또는 전화번호 중 하나는 필수입니다.
namestring optional 참가자의 이름 (선택 사항)
referralCodestring optional 다른 참가자로부터 받은 추천 코드 (선택 사항)
customFieldDataobject optional 사용자 정의 필드 데이터 객체 (선택 사항)
요청
curl -X POST https://blitzrocket.com/api/v1/contests/clx1abc123/entries \
-H "x-api-key: your_private_key_here" \
-H "Content-Type: application/json" \
-d '{
"email": "newuser@example.com",
"name": "New User",
"referralCode": "REF-XYZ789"
}'
응답 (201 Created)
{
"success": true,
"data": {
"entryId": "entry_new789",
"email": "newuser@example.com",
"alreadyExists": false,
"isReferred": true,
"pointsAwarded": {
"advocate": 10,
"friend": 5
}
}
}
이메일이 이미 콘테스트에 존재하는 경우, 응답에는 "alreadyExists": true가 포함되며 상태 코드는 200 OK가 됩니다.
참가 내역 수정
/api/v1/entries/:entryId기존 참가 내역의 정보를 수정합니다. 최소 하나 이상의 필드를 제공해야 합니다.
경로 매개변수
entryIdstring required 고유 참가 내역 식별자
요청 본문
namestring optional 수정된 이름
emailstring optional 수정된 이메일 주소
phonestring optional 수정된 전화번호
customFieldDataobject optional 수정된 사용자 정의 필드 데이터
요청
curl -X PUT https://blitzrocket.com/api/v1/entries/entry_abc123 \
-H "x-api-key: your_private_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Jane Updated",
"phone": "+1987654321"
}'
응답
{
"success": true,
"data": {
"id": "entry_abc123",
"email": "jane@example.com",
"name": "Jane Updated",
"phone": "+1987654321",
"points": 150
}
}
참가 자격 박탈
/api/v1/entries/:entryId/disqualify참가 내역의 자격을 박탈하거나 다시 부여합니다.
경로 매개변수
entryIdstring required 고유 참가 내역 식별자
요청 본문
disqualifyboolean optional true로 설정하면 자격 박탈, false로 설정하면 자격을 다시 부여합니다. 생략하면 현재 상태가 전환됩니다.
요청
curl -X POST https://blitzrocket.com/api/v1/entries/entry_abc123/disqualify \
-H "x-api-key: your_private_key_here" \
-H "Content-Type: application/json" \
-d '{"disqualify": true}'
응답
{
"success": true,
"data": {
"entryId": "entry_abc123",
"disqualified": true,
"message": "Entry has been disqualified"
}
}
포인트 조정
/api/v1/entries/:entryId/points참가 내역의 포인트를 추가하거나 차감합니다. 포인트는 0 미만으로 내려갈 수 없습니다.
경로 매개변수
entryIdstring required 고유 참가 내역 식별자
요청 본문
pointsnumber required 추가할(양수) 또는 차감할(음수) 포인트
reasonstring required 조정 사유
요청
curl -X POST https://blitzrocket.com/api/v1/entries/entry_abc123/points \
-H "x-api-key: your_private_key_here" \
-H "Content-Type: application/json" \
-d '{
"points": 50,
"reason": "Bonus for completing survey"
}'
응답
{
"success": true,
"data": {
"message": "Successfully added 50 points",
"previousTotal": 150,
"newTotal": 200,
"adjustment": 50
}
}
포인트를 차감하려면 음수 값을 사용하세요:
{
"points": -25,
"reason": "Penalty for rule violation"
}
오류 응답
이 엔드포인트에서 자주 발생하는 오류 응답입니다.
| 상태 코드 | 오류 | 설명 |
|---|---|---|
400 | points 또는 reason 누락 | 두 필드 모두 필수입니다 |
403 | 비공개 키 필요 | 이 엔드포인트는 비공개 API 키가 필요합니다 |
404 | 참가 내역을 찾을 수 없음 | 해당 ID의 참가 내역이 존재하지 않습니다 |