REST APIActivity

Open an activity box

POST
/activities/{activityCode}/boxes/{boxId}/open

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.

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.

boxId*string

The box's id, from GET /v1/activities/{activityCode}/me/boxes.

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/string/open'
Example Response
{  "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"    }  }}