REST APIActivity
Open an activity box
Opens one of the signed-in wallet's revealed boxes and returns it with its reward. The
reward is delivered afterwards, and the box's status goes from CLAIMED to
CREDITED once it has been.
Opening a box twice is safe. The second request returns the box with opened set to
false.
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. A box that
is not the wallet's, or that the wallet has not revealed, is a 404.
This endpoint can have breaking changes without notice, and it can be removed after the activity ends.
ApiKeyAuthBearerAuthx-api-key<token>API key authentication via the x-api-key header.
AuthorizationBearer <JWT>Bearer authentication via the Authorization: Bearer <token> header.
activityCode*stringThe activity's code, for example lol-worlds or cs2-major.
boxId*stringThe box's id, from GET /v1/activities/{activityCode}/me/boxes.
application/json; charset=utf-8- response
success*booleandata*curl -X POST 'https://api.predict.fun/v1/activities/string/boxes/string/open'{ "success": true, "data": { "opened": true, "box": { "id": "string", "matchId": "string", "match": { "title": "string", "teams": [ { "name": "string", "shortName": "string", "logoUrl": "string" } ] }, "boxTypeId": "string", "status": "ALLOCATED", "revealedAt": "string", "openedAt": "string", "reward": { "rewardType": "TOKEN", "currencyId": 0, "symbol": "string", "decimals": 0, "amount": "string" }, "prizeType": "USDT" } }}Get activity boxes GET
The signed-in wallet's revealed boxes in the activity's current phase. Each box has its type, the match it was earned in and its status. An opened box also has its reward. A box the wallet has not revealed is not listed. Reveal boxes with POST /v1/activities/{activityCode}/matches/reveal-all. This endpoint can have breaking changes without notice, and it can be removed after the activity ends.
Open activity boxes POST
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.