In this guide, we will explain how to authenticate to our API service, as well as create your first NFT. We will walk you through several endpoints to help you get started. We will cover the following topics:
Prerequisites
You need a Quantum business account, if you don't have one, click to register in our Developer Portal, or follow our step-by-step guide, .
You need your Client ID and Client Secret which can be obtained from the as shown below.
📘
All the API calls for this guide run on a sandbox environment. You can test and experiment with API calls without causing any harm to the actual blockchain or data.
1. Authenticating
You will need your access credentials (Client ID and Client Secret) to obtain a bearer token and authorize all API calls. These credentials are necessary for authentication purposes.
📘
Please note that the base path for all NFT API endpoints is https://nft-api-sandbox.quantum.io
2. Creating a Contract
Let's start by defining your first contract. This contract will represent a collection for the NFTs. We will create a contract on the Polygon (MATIC) testnet chain.
📘
As the API calls are running in a sandbox environment, the contract will be created on a testnet chain. In this example we will create an NFT contract on the MATIC testnet chain.
HTTP
POST /api/v2/contracts/deployments
Request Body:
Parameter
Description
Type
Required
name
The name of your NFT collection/contract
String
✅
description
The description of your NFT collection/contract
String
✅
image
The image URL for your NFT collection/contract that will be displayed
String
✅
externalUrl
This can be any link such as a link to your website, landing page, etc.
String
✅
chain
This is the blockchain on which you want to create the contract on
This endpoint is used to check the status of a contract/collection on v2. The {deploymentId} in the path is for tracking the status of contract creation. It is in the response body of the create contract/collection endpoint as result.id.
HTTP
GET /api/v2/contracts/deployments/{deploymentId}
Example Request
HTTP
GET /api/v2/contracts/deployments/4c1a078e-1b48-4280-882c-d0cd1dbd9a8f
Response Body
📘
In the response body look for the result.status parameter. It can have three possible values:
Next, we will create a token-type which serves as a template for minting NFTs. This means you just have to define the NFT template once with parameters like its name, image, attributes, etc, and then you can mint multiple NFTs directly to your end-users wallets.
HTTP
POST /api/v2/token-types/creations
Request Body:
Parameter
Description
Type
Required
secretType
The blockchain of the contract
String
✅
contractAddress
The contract address under which you want to create the token-type
String
✅
creations
An array of objects that can define one or multiple token-type details
Array of objects
✅
creations.name
The name of the token-type
String
✅
creations.description
The description of the token-type
String
❌
creations.image
The image URL for the token-type that will be displayed
String
❌
JSON
{
"secretType": "MATIC",
"contractAddress": "0xf5b11b4f458cc12a7989a146c5db2e7d500e2241",
"creations": [
{
"name": "My first NFT Token-type",
"description": "Quantum",
"image": "https://storage-qa.quantum.io/applications/1f64ded9-2a05-4824-b682-661023359357/StickFigureHi.png"
}
]
}
Response Body:
📘
Save the result.creations.id from the response body. This is the token Creation ID and it's used to track the status of the token-type creation request.
The status attribute indicates the token-type creation status.
This endpoint is used to check the status of token-type creation. The {creationId} in the path is for tracking the status of token-type creation. It is in the response body of the create token-type endpoint as result.id.
HTTP
GET /api/v2/token-types/creations/{creationId}
Example Request
HTTP
GET /api/v2/token-types/creations/45cf858a-cb0d-4e31-b6e1-b3bf4c65d014
Response Body
📘
In the response body look for the result.status parameter. It can have three possible values:
Make sure the destinations.address (wallet address) has the same chain as the contract. In this case, it should be a Polygon wallet(MATIC).
NOTE: The contractAddress, secretType (blockchain), and the tokenTypeId are defined in the request body.
Response Body:
📘
Under the mints array, you can find the id (mintId) for each minted NFT listed with the wallet address. This unique id can be used to track the status of the mint request.
The status attribute indicates the on-chain token mint status.
This endpoint is used to check the status of NFT mints. The {mintId} in the path is for tracking the status of the NFT mint. It is in the response body of the Mint Fungible or Non-Fungible Tokens endpoint as result.mints.id.
HTTP
GET /api/v2/tokens/mints/{mintId}
Example Request
HTTP
GET /api/v2/tokens/mints/037d23c9-9163-4e16-894e-338e5b1628fe
Response Body
📘
You can get the tokenId in the response body.
In the response body look for the result.status parameter. It can have three possible values: