API Reference
エントリー
コンテストのエントリーを作成、取得、更新、管理する
エントリー
コンテスト参加者とそのエントリーを管理します。
エントリー一覧
/api/v1/contests/:contestId/entries特定のコンテストのエントリーのページネーションされたリストを返します。
パスパラメータ
contestIdstring required 一意のコンテスト識別子
クエリパラメータ
pagenumberページ番号。1から開始。デフォルト: 1
limitnumber1ページあたりのエントリー数(1-100)。デフォルト: 20
searchstringメールアドレスまたは名前で検索(大文字小文字を区別しない)
リクエスト
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/contests/:contestId/entriesコンテストの新しいエントリーを作成します。プライベートAPIキーが必要です。
パスパラメータ
contestIdstring required 一意のコンテスト識別子
リクエストボディ
emailstring参加者のメールアドレス。email または phone のいずれかが必須です。
phonestring参加者の電話番号。email または phone のいずれかが必須です。
namestring参加者の名前(任意)
referralCodestring他の参加者からの紹介コード(任意)
customFieldDataobjectカスタムフィールドデータオブジェクト(任意)
リクエスト
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既存のエントリー情報を更新します。少なくとも1つのフィールドを指定する必要があります。
パスパラメータ
entryIdstring required 一意のエントリー識別子
リクエストボディ
namestring更新する名前
emailstring更新するメールアドレス
phonestring更新する電話番号
customFieldDataobject更新するカスタムフィールドデータ
リクエスト
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 一意のエントリー識別子
リクエストボディ
disqualifybooleantrue に設定すると失格、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 | ポイントまたは理由が不足 | 両方のフィールドが必須です |
403 | プライベートキーが必要 | このエンドポイントはプライベートAPIキーが必要です |
404 | エントリーが見つかりません | 指定されたIDのエントリーが存在しません |