End-to-end Example
Programmatic gating for customers holding an Ethereum ERC1155 NFT
1. Get your API keys

2. Check Ownership
Response (by default)
Last updated
curl -X POST https://api.3mint.io/api/v1/tokenGate
-H "Content-Type: application/json"
-H "X-API-KEY: [YOUR_API_KEY]"
-d '{"walletAddress": "[WALLET_OF_USER]",
"chain": "ethereum",
"network": "mainnet",
"requirements": [
{
"type": "erc721",
"contractAddress": "[PROJECT_CONTRACT_ADDRESS]",
"minBalance": 1,
}
]
}'import axios from 'axios';
// replace with your 3mint api key
const apiKey = 'demo';
const url = 'https://api.3mint.io/api/v1/tokenGate';
// Include conditions to verify
const ownerAddress = '[WALLET_OF_USER]'
const contractAddress = '[PROJECT_CONTRACT_ADDRESS]'
var requestOptions = {
method: 'POST',
url: `${url}`,
headers: {
'Content-Type': 'application/json',
'X-API-KEY': `${apiKey}`
},
data: {
'walletAddress': `${ownerAddress}`,
'chain': 'ethereum',
'network': 'mainnet',
'requirements': [
{
'type': 'erc721',
'contractAddress': `${contractAddress}`,
'minBalance': 1,
}
]
}
};
axios(config)
.then(response => console.log(response))
.catch(error => console.log(error));import fetch from 'node-fetch';
// replace with your 3mint api key
const apiKey = 'demo';
const fetchURL = 'https://api.3mint.io/api/v1/tokenGate';
// Include conditions to verify
const ownerAddress = '[WALLET_OF_USER]'
const contractAddress = '[PROJECT_CONTRACT_ADDRESS]'
var requestBody = JSON.stringify({
'walletAddress': `${ownerAddress}`,
'chain': 'ethereum',
'network': 'mainnet',
'requirements': [
{
'type': 'erc721',
'contractAddress': `${contractAddress}`,
'minBalance': 1,
}
]
});
var requestOptions = {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': `${apiKey}`
},
body: requestBody,
};
// Make the request and print the formatted response:
fetch(fetchURL, requestOptions)
.then(response => response.json())
.then(response => console.log(response))
.catch(error => console.log('error', error));{ "result" : true }