APIリファレンス

ボーナスアクション

コンテストエントリーのボーナスアクションを取得して完了する

ボーナスアクション

ボーナスアクションは、参加者がコンテストで追加ポイントを獲得するために完了できるタスクです。これらのエンドポイントを使用して、利用可能なボーナスアクションを取得し、完了済みとしてマークします。


ボーナスアクションを取得する

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

特定のエントリーに対するすべてのボーナスアクションとその完了状況を取得します。

パスパラメータ

entryIdstring required

一意のエントリー識別子。'lookup'を指定し、クエリパラメータを使うとメールアドレスから検索できます。

クエリパラメータ(entryIdが "lookup" の場合)

emailstring required

検索するメールアドレス

contestIdstring required

検索対象のコンテストID

リクエスト

bash
# By entry ID
curl -X GET https://blitzrocket.com/api/v1/entries/entry_abc123/bonus-actions \
  -H "x-api-key: your_api_key_here"

# By email lookup
curl -X GET "https://blitzrocket.com/api/v1/entries/lookup/bonus-actions?email=jane@example.com&contestId=clx1abc123" \
  -H "x-api-key: your_api_key_here"

レスポンス

json
{
  "success": true,
  "data": {
    "entryId": "entry_abc123",
    "email": "jane@example.com",
    "totalPoints": 150,
    "bonusActionsCompleted": 2,
    "bonusActionsTotal": 5,
    "bonusPointsEarned": 30,
    "actions": [
      {
        "id": "ba_001",
        "action": "follow_twitter",
        "description": "Follow us on Twitter",
        "icon": "twitter",
        "iconColor": "#1DA1F2",
        "points": 10,
        "confirmationType": "auto",
        "destinationUrl": "https://twitter.com/blitzrocket",
        "order": 1,
        "completed": true,
        "completedAt": "2025-06-15T12:00:00.000Z",
        "completionStatus": "verified"
      },
      {
        "id": "ba_002",
        "action": "share_referral",
        "description": "Share your referral link",
        "icon": "share",
        "iconColor": "#10B981",
        "points": 20,
        "confirmationType": "manual",
        "destinationUrl": null,
        "order": 2,
        "completed": true,
        "completedAt": "2025-06-16T09:30:00.000Z",
        "completionStatus": "verified"
      },
      {
        "id": "ba_003",
        "action": "visit_website",
        "description": "Visit our product page",
        "icon": "link",
        "iconColor": "#6366F1",
        "points": 5,
        "confirmationType": "click",
        "destinationUrl": "https://example.com/product",
        "order": 3,
        "completed": false,
        "completedAt": null,
        "completionStatus": null
      }
    ]
  }
}

レスポンスフィールド

entryIdstring

エントリー識別子

emailstring

参加者のメールアドレス

totalPointsnumber

エントリーの合計ポイント

bonusActionsCompletednumber

完了したボーナスアクションの数

bonusActionsTotalnumber

利用可能なボーナスアクションの総数

bonusPointsEarnednumber

ボーナスアクションで獲得したポイント

actions[].idstring

ボーナスアクションの一意識別子

actions[].actionstring

アクションタイプの識別子

actions[].pointsnumber

このアクションの完了で付与されるポイント

actions[].completedboolean

このアクションが完了しているかどうか


ボーナスアクションを完了する

POST/api/v1/entries/:entryId/bonus-actions/:bonusActionId/complete
Public or Private API Key

エントリーのボーナスアクションを完了済みとしてマークし、関連するポイントを付与します。

パブリックAPIキーを使用する場合は、参加者のエントリーセッショントークンもx-entry-session-tokenヘッダーで送信する必要があります。このトークンは、/api/v1/widget/:contestId/enterと/api/v1/widget/:contestId/verifyからentrySessionTokenとして返されます。また、リクエストはコンテストに設定された埋め込みドメインから送信する必要があります。トークンがない場合、このエンドポイントはerror: "entry_session_required"とともに401を返します。

パブリックキーの場合、審査が必要なアクション(アップロード、テキスト回答、APIまたはWebhookで検証するアクション)は保留中として保存され、pendingReview: trueが返されます。ポイントは運営者が承認した時点で付与されます。プライベートAPIキーの場合は、ポイントがすぐに付与されます。

ヘッダー

x-api-keystring required

パブリックAPIキーまたはプライベートAPIキー

x-entry-session-tokenstring optional

パブリックAPIキーを使用する場合は必須です。ウィジェットのenter/verifyエンドポイントから取得したエントリーセッショントークンです。

パスパラメータ

entryIdstring required

一意のエントリー識別子

bonusActionIdstring required

一意のボーナスアクション識別子

リクエストボディ

proofstring optional

完了の証明(任意。例:スクリーンショットのURL)

answerstring optional

クイズタイプのボーナスアクション用の回答(任意)

リクエスト

bash
curl -X POST https://blitzrocket.com/api/v1/entries/entry_abc123/bonus-actions/ba_003/complete \
  -H "x-api-key: your_api_key_here" \
  -H "x-entry-session-token: token_from_widget_enter_or_verify" \
  -H "Content-Type: application/json" \
  -d '{}'

レスポンス(新規完了)

json
{
  "success": true,
  "data": {
    "alreadyCompleted": false,
    "completedAt": "2025-06-17T14:00:00.000Z",
    "pointsAdded": 5,
    "newTotalPoints": 155,
    "message": "Bonus action completed successfully."
  }
}

レスポンス(すでに完了)

json
{
  "success": true,
  "data": {
    "alreadyCompleted": true,
    "completedAt": "2025-06-15T12:00:00.000Z",
    "message": "This bonus action has already been completed."
  }
}

エラー応答

このエンドポイントで発生する主なエラーレスポンスです。

ステータスエラー説明
400entryIdまたはbonusActionIdが不足両方のパスパラメータが必須です
401無効なAPIキーAPIキーが存在しないか無効です
404エントリーまたはボーナスアクションが見つかりません指定されたリソースは存在しません