This API endpoint allows clients to check if a specific Non-Fungible Token (NFT) is present within a wallet. This can be useful for scenarios like token gating, where access to specific resources or features is controlled based on token ownership.
Endpoint Details
Request Response
Query Parameters
User can be identified by one of the parameter:
Response format
Copy result : {
value : number , // 0,1,...
transactionStatus ?: string // "pending" or "complete"
} | error ? : IResponseError
Success response
Copy {
"result" : {
"value" : 3 ,
"transactionStatus" : "finished"
}
}
Error messages
More than one user ID is defined.
{ "code: 400, "message": "Validation error: \"value\" must contain at least one of [email, phone, walletId, walletAddress]" }
Contracts not found
{ "code: 400, "message": "Contracts not found" }
User wallet not found
{ "code: 400, "message": "User wallet not found" }
Examples
CURL Python NodeJS
Copy curl -X GET "https://sandbox.api.labs.zelus.io/v1/wallet/nft/balance?contractId=contract_63b848e9-b316-48a3-adfd-065403ab88ae&nftTokenId=1&email=email@example.com" \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY"
Copy import requests
url = "https://sandbox.api.labs.zelus.io/v1/wallet/nft/balance"
headers = {
"Content-Type" : "application/json" ,
"x-api-key" : "YOUR_API_KEY"
}
data = {
"contractId" : "contract_63b848e9-b316-48a3-adfd-065403ab88ae" ,
"nftTokenId" : "2" ,
"walletAddress" : "0x0097f04ac9b2af2fb40c2c30a65023a78eaff5d6"
}
response = requests . get (url, json = data, headers = headers)
print (response. json ()[ "result" ][ "value" ])
Copy const axios = require ( 'axios' );
const url = "https://sandbox.api.labs.zelus.io/v1/wallet/nft/balance" ;
const headers = {
"Content-Type" : "application/json" ,
"x-api-key" : "YOUR_API_KEY"
};
const data = {
"contractId" : "contract_63b848e9-b316-48a3-adfd-065403ab88ae" ,
"nftTokenId" : "3" ,
"wallet" : "wallet_60afcf25-2c1f-4b90-9fea-6174fd416040"
};
axios .get (url , data , {headers})
.then (response => {
console .log ( response . data . result .value);
})
.catch (error => {
console .error (error);
});