RE:DREAMER Lab
Search
⌃K

Redeem Center

Welcome to the Redeem Center section of the API documentation. The following API documentation will guide you through the necessary steps to redeem an NFT via the RE:DREAMER API.

NFT Redemption

Redemption process:
  1. 1.
    Go to the redemption web app and connect your wallet.
  2. 2.
    The web app will display a list of campaigns.
  3. 3.
    Select a campaign from the list.
  4. 4.
    The web app will show a list of available NFTs for the selected campaign.
  5. 5.
    Choose an NFT to redeem.

STEP 1: List campaigns for a network

To retrieve the list of campaigns available for a specific network, send a GET request to the following endpoint:
get
/api/v1/redeemcenter/:network/campaigns
List campaigns for a network
Returns a list of valid campaigns for a given network.
Parameters
Path
network*
Unique identifier of the network. Currently only eth is supported.
Query
startTime
DateTime
ISO 8601 datetime format, e.g. 2023-02-26T15:59:59Z.
endTime
DateTime
ISO 8601 datetime format, e.g. 2023-02-28T15:59:59Z.
status
Status of the campaign, i.e. ongoing | scheduled | expired . Default value is ongoing.
mine
Boolean
Set to true to return only projects owned by the campaign creator. Default value is false.
Header
x-api-key*
API key.
Responses
200: OK

STEP 2: List RNFTs for a campaign

To retrieve the list of RNFTs eligible for redemption in a specific campaign, send a GET request to the following endpoint:
get
/api/v1/redeemcenter/:network/campaigns/:uuid/nfts
List RNFTs for a campaign
Returns a list of eligible Redeemable-NFTs (RNFTs) owned by the connected wallet for a specific campaign.
Parameters
Path
network*
Unique identifier of the network. Currently only eth is supported.
uuid*
The unique identifier of the campaign for which the list of eligible RNFTs is being retrieved.
Header
Authorization*
Bearer ${token}. Replace ${token} with the actual JWT.
Responses
200: OK

STEP 3: Get the signature

After obtaining the selected campaign's unique identifier, and the selected NFT's token identifier and contract address, you need to sign the following message by using the private key of the wallet address which will be used to redeem the NFT.
campaign_id:${campaign_id},contract_address:${contract_address},token_id:${token_id}

Metamask Playground

You can sign the message without building the UI by using Metamask Playground. Please follow these steps:
  1. 2.
    Click INSPECTOR button in the bottom right corner.
  2. 3.
    Copy the JSON below and paste it to playground inspector.
    {
    "jsonrpc": "2.0",
    "method": "eth_requestAccounts"
    }
  3. 4.
    Click Play button to connect to the wallet. This step will trigger a popup if Metamask wallet extension is installed in the web browser.
  4. 5.
    Select the wallet that will be connected and click Next button.
  5. 6.
    Click Connect button to connect the wallet.
  6. 7.
    Copy the JSON below and paste it to playground inspector.
    {
    "jsonrpc": "2.0",
    "method": "personal_sign",
    "params": [
    "campaign_id:${campaign_id},contract_address:${contract_address},token_id:${token_id}",
    "${address}"
    ],
    "id": 0
    }
  7. 8.
    Replace ${campaign_id} with selected campaign's unique identifier from STEP 1 and replace with the selected NFT's contract address and token identifier from STEP 2. Replace ${address} with the wallet address which will be used for redemption.
  8. 9.
    Click Play button to sign the message. This step will trigger popup if Metamask wallet extension is installed in the web browser.
  9. 10.
    Click Sign button in the popup.
  10. 11.
    In Metamask Playground, see the response payload and get the signature from the result. Example response can be seen below.
    {
    "jsonrpc": "2.0",
    "result": "0xef128476f6e17bc32ead6bddf3daf329c018d03ffc7ebb449c4fc30e36bbb65b20fe38a4303cf718fd1ec1ac675fcea86056d541cd2f88d5bfd2e73e52c2ead21c",
    "id": 0
    }

Build your own web app

In order to sign the message with your own UI. You can follow up the steps mentioned in the following tutorials.
For managing multiple wallets, e.g. Metamask, Gnosis, Coinbase wallet, we recommend to use web3-react packages which is developed by Uniswap.

STEP 4: Redeem an NFT

To redeem the selected NFT, send a POST request to the following endpoint:
post
/api/v1/redeemcenter/:network/campaigns/:uuid/redemption
Redeem an NFT for specific campaign
Parameters
Path
network
Unique identifier of the network. Currently only eth is supported.
uuid
The unique identifier of the campaign for which the list of eligible RNFTs is being retrieved.
Header
Authorization*
Bearer ${token}. Replace ${token} with the actual JWT.
Body
contract_address*
The address of the smart contract for the selected NFT.
signature*
Signature gotten from STEP 3.
token_id*
Integer
Unique identifier for an NFT within a specific smart contract.
user_input_data
JSON Object
Additional key-value pairs {"key":"value",...} which can be configured from Redeem Center's Campaign dashboard.
Responses
200: OK