REST APIActivity

Open activity boxes

POST
/activities/{activityCode}/boxes/open-all

Opens several of the signed-in wallet's revealed boxes in one request. Send an empty object to open every unopened box, boxTypeId to open every unopened box of one type, or boxIds to open the boxes it lists.

Returns what this request opened, counted by box type, with the total of the rewards. Boxes that were already open are left out, so a repeated request returns empty lists.

While boxes cannot be opened yet, the request fails with a 400 and activity_state_conflict, with OPEN_NOT_AVAILABLE as its details.reason. canOpen from GET /v1/activities/{activityCode}/me/box-summary tells when they can. An id in boxIds that is not a revealed box of the wallet is a 404, and no box is opened.

This endpoint can have breaking changes without notice, and it can be removed after the activity ends.

Authorization

ApiKeyAuthBearerAuth
headerx-api-key<token>

API key authentication via the x-api-key header.

headerAuthorizationBearer <JWT>

Bearer authentication via the Authorization: Bearer <token> header.

Path Parameters

activityCode*string

The activity's code, for example lol-worlds or cs2-major.

Request Body

application/json; charset=utf-8
  1. body
boxTypeId?string

Open every unopened box of this type, an id from the activity's box types. It cannot be combined with boxIds.

boxIds?array<string>

Open only these boxes, from 1 to 200 ids. An id listed twice counts once. It cannot be combined with boxTypeId.

Response Body

application/json; charset=utf-8
  1. response
success*boolean
data*
Example Request
curl -X POST 'https://api.predict.fun/v1/activities/string/boxes/open-all' \  -H 'Content-Type: application/json; charset=utf-8' \  -d '{}'
Example Response
{  "success": true,  "data": {    "boxCounts": [      {        "boxTypeId": "string",        "openedCount": 0,        "prizeType": "USDT",        "rewardPerBox": {          "rewardType": "TOKEN",          "currencyId": 0,          "symbol": "string",          "decimals": 0,          "amount": "string"        }      }    ],    "rewards": [      {        "rewardType": "TOKEN",        "currencyId": 0,        "symbol": "string",        "decimals": 0,        "amount": "string"      }    ]  }}