Developer console

Claim rewards

🚧

Important:

Request headers are required. See API basics introduction for more information.

Claim reward

Endpoint

POST /reward/claim

  • Creates a new Claim request for a reward contracts to claim reward tokens from a given user UID, for an associated app (set by the X-API-KEY) to an address.
  • Returns a new Claim (claim uid) associated.

📘

Note:

The request is partly asynchronous - this will immediately return the claim uid and perform the claim on the blockchain asynchronously.

To know when the claim has been executed on the blockchain, you can subscribe to the Webhook events or poll any of the Get claim details endpoints.

Request body

Request body fieldsTypeDescriptionRequired/Optional
reward_uidStringThe UID of the rewards contract where tokens should be claimed.Required
from_user_uidStringThe UID of the user who is claiming the tokens.Required
to_addressStringThe personal address of the user where tokens should be claimed and sentRequired

Request example

Sample: request body

{
  "reward_uid": "764893807463",
  "from_user_uid": "110985463782",
  "to_address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
}

Response

Response example

Sample: 201 Claim Response

You will receive a uid which refers to the claim details uid:

{
  "success": true,
  "data": {
    "uid": "324167489835", // (claim uid)
  }
}

You can use this uid to call and reference the other Claim endpoints. For example GET /reward/claim/{uid} with this uid will return the claim details.

Example

The following example creates a claim for the reward 123123123123 and user 111111111111 to the address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045.

# API_KEY is your api key
# TOKEN is the access token generated with your api key secret

curl -i \
  -X POST \ 
  -d "{\"reward_uid\":\"123123123123\",\"user_uid\":\"111111111111\",\"to_address\":\"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045\"}" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: API_KEY" \
  -H "Authorization: Bearer TOKEN" \
  "https://api.getoriginal.com/v1/reward/allocate"