How to verify NFT holder eligibility in the campaign
When you create a campaign on a platform like TaskOn, you often need to set the eligibility requirements for the campaign, such as users needing to own a Bored Ape Yacht Club (BAYC) NFT.
Step 1: Get specified NFT owned by address
Here you'll need four parameters: chain, collection_contract_address and wallet_address.
Once you have obtained all parameters, you can copy the following code:
curl --request GET \
--url 'https://api.footprint.network/api/v3/address/getWalletNFTBalance?chain=Ethereum&collection_contract_address=0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d&wallet_address=0x46efbaedc92067e6d60e84ed6395099723252496' \
--header 'API-KEY: your-api-key' \
--header 'accept: application/json'
Step 2: Run the script
In your terminal, you should see the following JSON response:
{
"message": "success",
"code": 0,
"data": [
{
"chain": "Ethereum",
"collection_contract_address": "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
"wallet_address": "0x46efbaedc92067e6d60e84ed6395099723252496",
"nft_token_id": "1",
"amount": 1,
"floor_price": 0,
"floor_price_currency": "ETH"
}
]
}
Step 3: Deploy your validation API
After successfully testing the previous two steps, you can now embed it into your API server and deploy a public API to start using it.
API Reference
If you want to know more details on the endpoint and optional parameters, check out:
Updated 9 months ago