Unique Features
Solving application-to-blockchain connectivity challanges
How it works
In this example, we will use the ApiDapp REST interface to mint and publish "API Demo Token" NFT on Polygon Blockchain. API will generate metadata and publish it to IPFS storage, mint NFT, and transfer it to the "nft_recipient" account. An optional "callback_url" parameter can be used to get notifications about the progress.
copy
const fetch = require('node-fetch');
const headers = {
"name":"ApiDapp Demo Token",
"description" : "ApiDapp demo NFT token",
"image" : "http://www.libpng.org/pub/png/img_png/pnglogo-grr.jpg",
"nft_recipient" : "0x7964142a354dEd4eC727c70913CfE5885C2F505D",
"chain_id" : "137",
"attributes" : "[{\"display_type\": \"number\", \"trait_type\": \"Version\", \"value\": 25}]",
"callback_url" : "https://eogg3f2xuzgixe6.m.pipedream.net",
"Content-Type": "application/json",
"Authorization": "Bearer my-secret-token"
}
var raw = "";
var requestOptions = {
method: 'POST',
headers: headers,
body: raw,
redirect: 'follow'
};
fetch("https://api.apidapp.com/1/token/erc721", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
Give it a try