Get NFT Details by ID API
Retrieve details of a specific NFT using its unique ID through the `/v1/cl2c/nfts/{id}` endpoint.
The GET /v1/cl2c/nfts/{id}
endpoint allows you to retrieve the details of an NFT by providing its unique ID.
Endpoint
GET
/v1/cl2c/nfts/{id}
Fetches the details of the specified NFT.
Parameters
Name | Type | Location | Required | Description |
---|---|---|---|---|
id | string | Path | Yes | The unique ID of the NFT (UUID format). |
tenant | string | Header | Yes | Tenant ID for accessing this API. |
X-API-Key | string | Header | Yes | API Key ID for accessing this API. |
Responses
Success (200)
Content Type: application/json
The response includes detailed information about the NFT.
Example Response
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Sample NFT",
"description": "This is a sample NFT description.",
"externalUrl": "https://example.com/nft",
"imagePath": "https://example.com/image.png",
"smartContract": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"name": "Sample Smart Contract",
"symbol": "NFT",
"network": "Ethereum",
"deployed": true,
"deploymentTransactionHash": "0xabc123...",
"deploymentLogs": "Deployment logs here...",
"contractAddress": "0xdef456...",
"creatorAddress": "0xghi789...",
"totalSupply": 1000,
"description": "This is a sample smart contract."
},
"minted": true,
"mintTransactionHash": "0xjkl012...",
"mintLogs": "Minting logs here...",
"tokenId": 1,
"tokenUri": "https://example.com/token/1",
"tokenOwner": "0xownerAddress...",
"copyrighted": true,
"copyrightMetadata": "Copyright details here...",
"copyrightedAt": "2024-11-05T19:52:07.465Z",
"licence": "Standard License",
"signature": "Signature data here..."
}
Error Responses
400 Bad Request
Content Type: application/json
Indicates that the request was invalid.
Example Response
{
"type": "string",
"title": "Invalid Request",
"status": 400,
"detail": "The provided ID is not valid.",
"instance": "https://api.example.com/v1/cl2c/nfts/invalid-id",
"errors": {
"id": [
"Invalid UUID format."
]
}
}
Default Error Response
Content Type: application/json
May include general error information.
Example Response
{
"messages": [
"An unexpected error occurred."
],
"source": "NFT Service",
"exception": "NullReferenceException",
"errorId": "error-1234",
"supportMessage": "Contact support for assistance.",
"statusCode": 500
}
Code Samples
Usage in Different Frameworks
Node.js Example
const axios = require('axios');
const nftId = '3fa85f64-5717-4562-b3fc-2c963f66afa6'; // Replace with actual NFT ID
axios.get(`https://api.example.com/v1/cl2c/nfts/${nftId}`, {
headers: {
'tenant': 'your-tenant-id',
'X-API-Key': 'your-api-key'
}
})
.then(response => console.log(response.data))
.catch(error => console.error(error.response.data));