API Reference

エントリー

コンテストのエントリーを作成、取得、更新、管理する

エントリー

コンテスト参加者とそのエントリーを管理します。


エントリー一覧

GET/api/v1/contests/:contestId/entries
Public or Private API Key

特定のコンテストのエントリーのページネーションされたリストを返します。

パスパラメータ

contestIdstring required

一意のコンテスト識別子

クエリパラメータ

pagenumber

ページ番号。1から開始。デフォルト: 1

limitnumber

1ページあたりのエントリー数(1-100)。デフォルト: 20

searchstring

メールアドレスまたは名前で検索(大文字小文字を区別しない)

リクエスト

bash
curl -X GET "https://blitzrocket.com/api/v1/contests/clx1abc123/entries?page=1&limit=10" \
  -H "x-api-key: your_api_key_here"

レスポンス

json
{
  "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タイムスタンプ


エントリー取得

GET/api/v1/entries/:entryId
Public or Private API Key

特定のエントリーの詳細情報を取得します。

パスパラメータ

entryIdstring required

一意のエントリー識別子

リクエスト

bash
curl -X GET https://blitzrocket.com/api/v1/entries/entry_abc123 \
  -H "x-api-key: your_api_key_here"

レスポンス

json
{
  "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"
  }
}

エントリー作成

POST/api/v1/contests/:contestId/entries
Private API Key Required

コンテストの新しいエントリーを作成します。プライベートAPIキーが必要です。

パスパラメータ

contestIdstring required

一意のコンテスト識別子

リクエストボディ

emailstring

参加者のメールアドレス。email または phone のいずれかが必須です。

phonestring

参加者の電話番号。email または phone のいずれかが必須です。

namestring

参加者の名前(任意)

referralCodestring

他の参加者からの紹介コード(任意)

customFieldDataobject

カスタムフィールドデータオブジェクト(任意)

リクエスト

bash
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)

json
{
  "success": true,
  "data": {
    "entryId": "entry_new789",
    "email": "newuser@example.com",
    "alreadyExists": false,
    "isReferred": true,
    "pointsAwarded": {
      "advocate": 10,
      "friend": 5
    }
  }
}

もしメールアドレスがすでにコンテストに存在する場合、レスポンスには "alreadyExists": true が含まれ、ステータスは 200 OK となります。


エントリーの更新

PUT/api/v1/entries/:entryId
Private API Key Required

既存のエントリー情報を更新します。少なくとも1つのフィールドを指定する必要があります。

パスパラメータ

entryIdstring required

一意のエントリー識別子

リクエストボディ

namestring

更新する名前

emailstring

更新するメールアドレス

phonestring

更新する電話番号

customFieldDataobject

更新するカスタムフィールドデータ

リクエスト

bash
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"
  }'

レスポンス

json
{
  "success": true,
  "data": {
    "id": "entry_abc123",
    "email": "jane@example.com",
    "name": "Jane Updated",
    "phone": "+1987654321",
    "points": 150
  }
}

エントリーの失格処理

POST/api/v1/entries/:entryId/disqualify
Private API Key Required

エントリーを失格または再資格付与します。

パスパラメータ

entryIdstring required

一意のエントリー識別子

リクエストボディ

disqualifyboolean

true に設定すると失格、false に設定すると再資格付与。省略するとトグル動作。

リクエスト

bash
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}'

レスポンス

json
{
  "success": true,
  "data": {
    "entryId": "entry_abc123",
    "disqualified": true,
    "message": "Entry has been disqualified"
  }
}

ポイントの調整

POST/api/v1/entries/:entryId/points
Private API Key Required

エントリーのポイントを追加または削除します。ポイントは0未満にはなりません。

パスパラメータ

entryIdstring required

一意のエントリー識別子

リクエストボディ

pointsnumber required

追加(正の値)または削除(負の値)するポイント数

reasonstring required

調整の理由

リクエスト

bash
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"
  }'

レスポンス

json
{
  "success": true,
  "data": {
    "message": "Successfully added 50 points",
    "previousTotal": 150,
    "newTotal": 200,
    "adjustment": 50
  }
}

ポイントを削除するには、負の値を使用します:

json
{
  "points": -25,
  "reason": "Penalty for rule violation"
}

エラー応答

ステータスエラー説明
400ポイントまたは理由が不足両方のフィールドが必須です
403プライベートキーが必要このエンドポイントはプライベートAPIキーが必要です
404エントリーが見つかりません指定されたIDのエントリーが存在しません