API Reference
ボーナスアクション
コンテストエントリーのボーナスアクションを取得して完了する
ボーナスアクション
ボーナスアクションは、参加者がコンテストで追加ポイントを獲得するために完了できるタスクです。これらのエンドポイントを使用して利用可能なボーナスアクションを取得し、完了済みとしてマークします。
ボーナスアクションを取得する
GET
/api/v1/entries/:entryId/bonus-actions Public or Private API Key
特定のエントリーに対するすべてのボーナスアクションとその完了状況を取得します。
パスパラメータ
entryIdstring required 一意のエントリー識別子。クエリパラメータを使った 'lookup' でメールアドレスから検索可能です。
クエリパラメータ(entryIdが "lookup" の場合)
emailstring required 検索するメールアドレス
contestIdstring required 検索対象のコンテストID
リクエスト
bash
# エントリーIDによる取得
curl -X GET https://blitzrocket.com/api/v1/entries/entry_abc123/bonus-actions \
-H "x-api-key: your_api_key_here"
# メールアドレスによるルックアップ
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": "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": "紹介リンクをシェアする",
"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": "製品ページを訪問する",
"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
エントリーのボーナスアクションを完了済みとしてマークし、関連するポイントを付与します。
パスパラメータ
entryIdstring required 一意のエントリー識別子
bonusActionIdstring required 一意のボーナスアクション識別子
リクエストボディ
proofstring完了の証明(任意、例:スクリーンショットのURL)
answerstringクイズタイプのボーナスアクション用の回答(任意)
リクエスト
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 "Content-Type: application/json" \
-d '{}'
レスポンス(新規完了)
json
{
"success": true,
"data": {
"alreadyCompleted": false,
"completedAt": "2025-06-17T14:00:00.000Z",
"pointsAdded": 5,
"newTotalPoints": 155,
"message": "ボーナスアクションが正常に完了しました。"
}
}
レスポンス(すでに完了)
json
{
"success": true,
"data": {
"alreadyCompleted": true,
"completedAt": "2025-06-15T12:00:00.000Z",
"message": "このボーナスアクションはすでに完了しています。"
}
}
エラー応答
| ステータス | エラー | 説明 |
|---|---|---|
400 | entryId または bonusActionId が不足 | 両方のパスパラメータが必須です |
401 | 無効な API キー | API キーが存在しないか無効です |
404 | エントリーまたはボーナスアクションが見つからない | 指定されたリソースは存在しません |