In this guide, we will look into how you can add a video or multiple videos to your NFTs, Note that adding the videos will happen during the creation of the token-type (NFT tenplate).
📘
You need to have the URL of the video address that you wish to add.
Learn on quantum Servers.
Prerequisites
You already have an NFT collection (contract) created using the NFT-API. View the guide if you haven't.
contractAddress: The public address of your NFT contract.
Request Endpoint:
HTTP
POST /api/v2/token-types/creations
Example Request
We will use the create token-type endpoint and within the request body, we will specify the animationUrls array.
HTTP
POST /api/v2/token-types/creations
Request Body
📘
In the animationUrls array, we have defined the object with type: video and its value(The URL of the video address).
You can add multiple objects within the animationUrls array with images, videos, and even audio.
Read more about [animationUrls](https://docs.quantum.io/docs/animation-media)
JSON
{
"secretType": "MATIC",
"contractAddress": "0xf5b11b4f458cc12a7989a146c5db2e7d500e2241",
"creations": [{
"name": "NFT with a video",
"description": "This NFT has a video",
"image": "https://static.scientificamerican.com/sciam/cache/file/C91AC5AA-1F28-41E7-8E40EC59E66937D8_source.jpg?w=590&h=800&2113BA5E-A58F-4A28-ABDD0BE5C759F5B6",
"externalUrl": "www.quantum.io",
"animationUrls": [{
"type": "video",
"value": "https://player.vimeo.com/external/314181352.sd.mp4?s=d2cd7a37f6250cd543e6d13209730b4bcf242130&profile_id=164&oauth2_token_id=57447761"
}]
}]
}
Response Body
📘
The token-type was created successfully with a video included. You can check its status using the result.creations.id param.