Create an NFT
post
https://api.underdogprotocol.com
/v2/projects/:transferable/:projectId/nfts
Create an NFT
This endpoint allows you to create a new NFT.
Parameters
Path
transferable*
string
projectId*
integer
Body
Example
Schema
{
"name": "NFT #1",
"symbol": "NFT",
"description": "This is my first NFT",
"image": "https://example.com/image.png",
"animationUrl": "https://example.com/animation.mp4",
"attributes": {
"Points": "40000",
"Nickname": "LeGoat"
},
"receiverAddress": "EBeLw5jEdrEgDe17BdKGW2MizzGxtxigEuAGvYC7VzDp",
"upsert": true
}
Responses
200: OK
Returns an array of NFTs with upserted metadata
202: Accepted
401: Unauthorized
Unauthorized
403: Forbidden
Forbidden
404: Not Found
Not Found
cURL
JavaScript
curl --location --request POST 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts' \
--header 'Authorization: Bearer {token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "LeGoat",
"image": "https://sportshub.cbsistatic.com/i/r/2023/02/08/aa0a798f-6268-41ba-9be4-ea4ee03fd817/thumbnail/1200x675/421458d6419a36da2aaad75e10b2e347/king.jpg",
"attributes": {
"points": "38390"
}
}'
const axios = require('axios');
let data = JSON.stringify({
"name": "LeGoat",
"image": "https://sportshub.cbsistatic.com/i/r/2023/02/08/aa0a798f-6268-41ba-9be4-ea4ee03fd817/thumbnail/1200x675/421458d6419a36da2aaad75e10b2e347/king.jpg",
"attributes": {
"points": "38390"
}
});
let config = {
method: 'post',
url: 'https://dev.underdogprotocol.com/v2/projects/n/4/nfts',
headers: {
'Authorization': 'Bearer {token}',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Response
{
"transactionId": "c3f66040-89f2-4692-9987-e7d0465179ab",
"mintAddress": "Dic1tC9yBhaDerQpV8ZBAsruBUKQsRWtCWysG965ADWi"
}
Last modified 7mo ago