NFT API
This page provides routes for managing NFTs. The following routes are available:
GET/Get all NFTsPOST/Mint new NFTsPATCH/Claim an NFTPUT/assignAssign NFT to userGET/userGet user's NFTsPATCH/collections/:collectionId/tokens/:tokenId/transferTransfer an NFTPOST/create-assignCreate and assign NFTPOST/batch-mintBatch mint NFTsPOST/batch-mint-assignBatch mint and assign NFTsGET/:collectionId/:tokenIdGet NFT by token ID
Get NFTs
This endpoint gets all NFTs
GET https://nft-platform.azurewebsites.net/api/v1/nfts/
Create NFTs
This endpoint creates new NFTs.
POST https://nft-platform.azurewebsites.net/api/v1/nfts/
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires CUSTOMER role with write permission.
Parameters
File upload required (single file)
Example
{
"file": "multipart/form-data",
"formData": {
"name": "Example NFT",
"collectionId": "123456789abcdef123456789",
"file": "/path/to/example/image.jpg",
"description": "This is an example NFT description"
}
}{
"message": "NFT Created Successfully",
"response": {
"nft": {
"collection": {
"_id": "67a9a3898b4ab4ae22efcde8",
"category": "Collectible",
"contractAddress": "0x37baC36B2da283eA74D10669A7f87a51147126Cf",
"createdBy": "67a98689bc4810c0e57b07d7",
"description": "ewf erger",
"image": "https://nftplatform.ipfs.storage/67a986897ab94fbb2eb0ce54/wp8450146.jpg",
"name": "QUOTES",
"network": "amoy",
"createdAt": "2025-02-10T06:58:17.756Z",
"__v": 0,
"nfts": []
},
"created_by": "67a98689bc4810c0e57b07d7",
"description": "Trial NFTT",
"image": "https://nftplatform.ipfs.storage/67a986897ab94fbb2eb0ce54/logo-1933884_640.webp",
"name": "vvv7",
"owner": "67a986897ab94fbb2eb0ce54",
"tokenId": 3,
"txn_hash": "0xd69589b59fc097d5601310ac8407cef00e2fc40b54c3b59748899119de01b727"
}
},
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Claim NFT
This endpoint allows claiming an NFT.
PATCH https://nft-platform.azurewebsites.net/api/v1/nfts/
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires CUSTOMER role with update permission.
HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | Request successful |
| 400 | Bad Request | The request was invalid or cannot be processed |
| 401 | Unauthorized | Authentication is required or has failed |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action |
| 404 | Not Found | The requested resource could not be found |
| 500 | Internal Server Error | An unexpected error occurred |
Assign NFT
This endpoint allows assigning an NFT to a user.
PUT https://nft-platform.azurewebsites.net/api/v1/nfts/assign
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with read permission.
Request Body
| Field | Type | Description |
|---|---|---|
| string | Email of the user to assign the NFT to | |
| nftId | string | ID of the NFT to assign |
Example Request
{
"email": "user@example.com",
"nftId": "67b813e5a27f852b4de624ff"
}{
"message": "NFT assigned to user with email: user@example.com",
"nft": {
"assign": {
"assignedBy": "example123",
"assignedTo": "user@example.com",
"claim_code": {
"code": "example123456789"
},
"time": "2025-01-01T00:00:00.000Z"
},
"_id": "example123",
"attributes": [],
"created_by": "example123",
"description": "Example NFT",
"image": "https://example.com/example.jpg",
"name": "Example NFT",
"nftCollection": {
"_id": "example123",
"category": "Example",
"contractAddress": "0x1234567890111222",
"createdBy": "example123",
"description": "Example Collection",
"image": "https://example.com/example.jpg",
"name": "EXAMPLE",
"network": "example",
"createdAt": "2025-01-01T00:00:00.000Z",
"__v": 0,
"id": "example123"
},
"owner": "example123",
"tokenId": "1",
"txn_hash": "0x1234567890111222",
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T00:00:00.000Z",
"__v": 0,
"id": "example123"
},
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Get User NFT
This endpoint allows fetching NFTs assigned to a user.
GET https://nft-platform.azurewebsites.net/api/v1/nfts/user
Get NFTs assigned to the authenticated user.
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with read permission.
Example
{}{
"message": "Fetched nfts successfully.",
"nfts": [
{
"collection": {
"_id": "67a9a3898b4ab4ae22efcde8",
"category": "Collectible",
"contractAddress": "0x37baC36B2da283eA74D10669A7f87a51147126Cf",
"createdBy": "67a98689bc4810c0e57b07d7",
"description": "ewf erger",
"image": "https://nftplatform.ipfs.storage/67a986897ab94fbb2eb0ce54/hhhh.jpg",
"name": "EXAMPLE",
"network": "amoy",
"createdAt": "2025-02-10T06:58:17.756Z",
"__v": 0,
"nfts": []
},
"created_by": "67a98689bc4820c0e57b07d7",
"description": "Trial NFT",
"image": "https://nftplatform.ipfs.storage/67a986897ab94fbb2eb0ce54/image.webp",
"name": "Trial NFT",
"owner": "67a986897ab94fbb2eb0cr54",
"tokenId": 3,
"txn_hash": "0xd69589b59fc095d5601310ac5407cef00e2fc40b54c3b59748899119de01b727"
}
],
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Transfer NFT
This endpoint allows transferring an NFT to another user.
PATCH https://nft-platform.azurewebsites.net/api/v1/nfts/collections/:collectionId/tokens/:tokenId/transfer
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with write and update permission.
Parameters
| Parameter | Type | Description |
|---|---|---|
collectionId | string | The ID of the collection to which the NFT belongs. |
tokenId | string | The ID of the NFT to be transferred. |
{
"receiver": "example123@gmail.com" // receiver can be wallet address or email
}{
"message": "NFT transferred successfully",
"status": "success",
"transactionResponse": {
"hash": "0x1234567890abcdef1234567890abcde...7890abcdef1234567890abcdef",
"blockNumber": 12345678,
"blockHash": "0x1234567890abcdef1234567890ab....def1234567890abcdef",
"timestamp": 1645432198,
"confirmations": 1,
"from": "0x1234567890123456789012345678901234567890",
"to": "0x0987654321098765432109876543210987654321",
"tokenId": 123,
"gasUsed": "21000",
"effectiveGasPrice": "20000000000"
},
/*
The updated NFT data is only returned if the `receiver` field in the
request body is a valid email address and the NFT is successfully
transferred to the specified user.
*/
"updatedNFT": {
"_id": "123456789012345678901234",
"name": "Example NFT",
"description": "This is an example NFT",
"image": "https://example.com/nft.jpg",
"tokenId": 123,
"nftCollection": "123456789012345678901234",
"owner": "0x1234567890123456789012345678901234567890",
"createdBy": "123456789012345678901234",
"assign": null,
"attributes": [],
"txn_hash": "0x12345678901234567890123....34567890123456789012345678901234"
}
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Create and Assign NFT
This endpoint allows creating and assigning an NFT to a user.
POST https://nft-platform.azurewebsites.net/api/v1/nfts/create-assign
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with write permission.
{
"file": "multipart/form-data",
"formData": {
"name": "Example NFT",
"collectionId": "123456789abcdef123456789",
"file": "/path/to/example/image.jpg",
"description": "This is an example NFT description",
"email": "user@example.com"
}
}{
"message": "NFT created and assigned to user with email: example123@gmail.com",
"nft": {
"assign": {
"assignedBy": "67a98689bc4810c0e57b07d7",
"assignedTo": "example123@gmail.com",
"claim_code": {
"code": "c4c2ca62a3f5a44b11a0"
},
"time": "2025-02-21T12:36:32.334Z"
},
"_id": "67b8734f98bdaaaeafda1bee",
"attributes": [],
"created_by": "67a98689bc4810c0e57b07d7",
"description": "Trial NFT Creation",
"image": "https://nftplatform.ipfs.storage/67a986897ab94fbb2eb0ce54/image.jpg",
"name": "Example",
"nftCollection": {
"_id": "67a9a3898b4ab4ae22efcde8",
"category": "Collectible",
"contractAddress": "0x37baC36B2da283eA74D10669A7f87a51147126Cf",
"createdBy": "67a98689bc4810c0e57b07d7",
"description": "Description for the collection",
"image": "https://nftplatform.ipfs.storage/67a986897ab94fbb2eb0ce54/image.jpg",
"name": "EXAMPLE",
"network": "amoy",
"createdAt": "2025-02-10T06:58:17.756Z",
"__v": 0,
"id": "67a9a3898b4ab4ae22efcde8"
},
"owner": "67a98689bc4810c0e57b07d7",
"tokenId": "4",
"txn_hash": "0xcdd52200fa301548d73a1f4fd5a88283b639abd5fae939a660446a8b9f9be3e7",
"createdAt": "2025-02-21T12:36:31.802Z",
"updatedAt": "2025-02-21T12:36:32.333Z",
"__v": 0,
"id": "67b8734f98bdaaaeafda1bee"
},
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Batch Mint NFT
This endpoint allows creating multiple NFTs in a single request.
POST https://nft-platform.azurewebsites.net/api/v1/nfts/batch-mint
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with write permission.
{
"file": "multipart/form-data",
"formData": {
"nfts": "[{"name": "NFT 1", "description": "Description 1"}, {"name": "NFT 2", "description": "Description 2"}]",
"collectionId": "123456789abcdef123456789"
}
}{
"message": "NFTs minted successfully.",
"status": "success",
"nfts": [
{
"_id": "987654321abcdef987654321",
"attributes": [],
"description": "Example NFT Description 1",
"image": "https://example.com/nft1.jpg",
"name": "Example NFT 1",
"nftCollection": {
"_id": "collection123456789abc",
"category": "Digital Art",
"contractAddress": "0x1234567890abcdef1234567890abcdef12345678",
"createdBy": "123456789abcdef123456789",
"description": "Example Collection Description",
"image": "https://example.com/collection.jpg",
"name": "Example Collection",
"network": "ethereum",
"createdAt": "2024-01-01T00:00:00.000Z",
"__v": 0,
"id": "collection123456789abc"
},
"owner": "123456789abcdef123456789",
"tokenId": "1",
"txn_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"__v": 0,
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z",
"id": "987654321abcdef987654321"
},
{
"_id": "987654321abcdef987654322",
"attributes": [],
"description": "Example NFT Description 2",
"image": "https://example.com/nft2.jpg",
"name": "Example NFT 2",
"nftCollection": {
"_id": "collection123456789abc",
"category": "Digital Art",
"contractAddress": "0x1234567890abcdef1234567890abcdef12345678",
"createdBy": "123456789abcdef123456789",
"description": "Example Collection Description",
"image": "https://example.com/collection.jpg",
"name": "Example Collection",
"network": "ethereum",
"createdAt": "2024-01-01T00:00:00.000Z",
"__v": 0,
"id": "collection123456789abc"
},
"owner": "123456789abcdef123456789",
"tokenId": "2",
"txn_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"__v": 0,
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z",
"id": "987654321abcdef987654322"
}
]
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Batch Mint And Assign NFT
This endpoint allows minting and assigning multiple NFTs to users in a single request.
POST https://nft-platform.azurewebsites.net/api/v1/nfts/batch-mint-assign
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with write permission.
{
"file": "multipart/form-data",
"formData": {
"nfts": "[{"name": "NFT 1", "description": "Description 1"}, {"name": "NFT 2", "description": "Description 2"}]",
"collectionId": "123456789abcdef123456789",
"email": "user@example.com"
}
}{
"message": "NFTs created and assigned to users successfully",
"nfts": [
{
"assign": {
"assignedBy": "123456789abcdef123456789",
"assignedTo": "user@example.com",
"claim_code": {
"code": "abc123def456ghi789xyz"
},
"time": "2024-01-01T10:00:00.000Z"
},
"_id": "987654321abcdef987654321",
"attributes": [],
"description": "Example NFT Description 1",
"image": "https://example.com/nft1.jpg",
"name": "Example NFT 1",
"nftCollection": {
"_id": "collection123456789abc",
"category": "Digital Art",
"contractAddress": "0x1234567890abcdef1234567890abcdef12345678",
"createdBy": "123456789abcdef123456789",
"description": "Example Collection Description",
"image": "https://example.com/collection.jpg",
"name": "Example Collection",
"network": "ethereum",
"createdAt": "2024-01-01T00:00:00.000Z",
"__v": 0,
"id": "collection123456789abc"
},
"owner": "123456789abcdef123456789",
"tokenId": "1",
"txn_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"__v": 0,
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z",
"id": "987654321abcdef987654321"
},
{
"assign": {
"assignedBy": "123456789abcdef123456789",
"assignedTo": "user@example.com",
"claim_code": {
"code": "xyz789def456abc123"
},
"time": "2024-01-01T10:00:00.000Z"
},
"_id": "987654321abcdef987654322",
"attributes": [],
"description": "Example NFT Description 2",
"image": "https://example.com/nft2.jpg",
"name": "Example NFT 2",
"nftCollection": {
"_id": "collection123456789abc",
"category": "Digital Art",
"contractAddress": "0x1234567890abcdef1234567890abcdef12345678",
"createdBy": "123456789abcdef123456789",
"description": "Example Collection Description",
"image": "https://example.com/collection.jpg",
"name": "Example Collection",
"network": "ethereum",
"createdAt": "2024-01-01T00:00:00.000Z",
"__v": 0,
"id": "collection123456789abc"
},
"owner": "123456789abcdef123456789",
"tokenId": "2",
"txn_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"__v": 0,
"createdAt": "2024-01-01T10:00:00.000Z",
"updatedAt": "2024-01-01T10:00:00.000Z",
"id": "987654321abcdef987654322"
}
],
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |
Get NFT By Token ID
This endpoint allows fetching an NFT by its token ID.
GET https://nft-platform.azurewebsites.net/api/v1/nfts/nft/:collectionId/:tokenId
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with read permission.
Parameters
| Name | Type | Description |
|---|---|---|
| collectionId | string | The ID of the NFT collection |
| tokenId | string | The token ID of the NFT |
{
"blockExplorerUrl": "https://amoy.polygonscan.com",
"message": "Fetched nft successfully.",
"nft": {
"assign": {
"assignedBy": "123456789abcdef123456789",
"assignedTo": "user@example.com",
"claim_code": {
"code": "abc123def456xyz789"
},
"time": "2024-01-01T10:00:00.000Z"
},
"_id": "987654321abcdef987654321",
"attributes": [],
"description": "Example NFT Description",
"image": "https://example.com/nft.jpg",
"name": "Example NFT",
"nftCollection": {
"_id": "collection123456789abc",
"category": "Digital Art",
"contractAddress": "0x1234567890abcdef1234567890abcdef12345678",
"createdBy": "123456789abcdef123456789",
"description": "Example Collection Description",
"image": "https://example.com/collection.jpg",
"name": "Example Collection",
"network": "ethereum",
"createdAt": "2024-01-01T00:00:00.000Z",
"__v": 0,
"id": "collection123456789abc"
},
"owner": "123456789abcdef123456789",
"tokenId": "1",
"txn_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"__v": 0,
"createdAt": "2024-01-01T10:00:00.000Z"
},
"openseaUrl": "https://opensea.io",
"owner": "0x1234567890abcdef1234567890abcdef12345678",
"status": "success",
"transactions": [
{
"blockNumber": "12345678",
"from": "0x0000000000000000000000000000000000000000",
"to": "0x1234567890abcdef1234567890abcdef12345678",
"transactionHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"timestamp": "2024-01-01T10:00:00.000Z"
}
]
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an apikey object. |
| 400 | Bad Request | The request was invalid or cannot be processed. |
| 401 | Unauthorized | Authentication is required or has failed. |
| 403 | Forbidden | The authenticated user is not authorized to perform the requested action. |
| 404 | Not Found | The requested resource could not be found. |
| 500 | Internal Server Error | An unexpected error occurred. |