Collection API
This page provides routes for managing collections. The following routes are available:
POST/Create a new collectionGET/Get all collectionsGET/userGet user collectionsGET/categoriesGet collection categoriesGET/:idGet a collection by ID
Create Collection
This endpoint allows creating a new collection.
POST https://nft-platform.azurewebsites.net/api/v1/collections/
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with write permission.
{
"file": "multipart/form-data",
"formData": {
"name": "Example Collection",
"symbol": "EXC",
"file": "/path/to/example/image.jpg",
"description": "This is an example collection description",
"category": "Art",
"network": "Amoy"
}
}{
"collection": {
"category": "Art",
"contractAddress": "0xbb0F8319518dC500937526090FFef3f475e27d48",
"createdBy": "67a98689bc4810c0e57b07d7",
"description": "This is an example collection description",
"image": "https://nftplatform.ipfs.storage/67a986897ab94fbb2eb0ce54/35af6a41332353.57a1ce913e889.jpg",
"name": "Example Collection",
"symbol": "EXC",
"network": "Amoy",
"_id": "67bc6994027599bc66efa5e1",
"createdAt": "2025-02-24T12:44:04.713Z",
"__v": 0,
"id": "67bc6994027599bc66efa5e1"
},
"message": "Collection created successfully.",
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of apikey objects and |
| 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 Collections
This endpoint allows retrieving all collections.
GET https://nft-platform.azurewebsites.net/api/v1/collections/
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with read permission.
{
"collections": [
{
"_id": "123abc456def789",
"category": "Art",
"contractAddress": "0x1234567890abcdef1234567890abcdef12345678",
"createdBy": {
"_id": "user123abc",
"accountAddress": "0xabcdef1234567890abcdef1234567890abcdef12",
"deleted": false,
"email": "example@email.com",
"orgId": "org123abc",
"privateKey": "encryptedPrivateKey",
"userId": "user456def",
"credits": [],
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z",
"__v": 0,
"creditsRemaining": 100,
"creditsTotal": 100,
"creditsUsed": 0,
"id": "user123abc"
},
"description": "Example collection description",
"image": "https://example.com/image.jpg",
"name": "Example Collection",
"network": "testnet",
"createdAt": "2024-01-01T00:00:00.000Z",
"__v": 0,
"nfts": [
{
"assign": {
"claim_code": {
"code": "exampleClaimCode"
},
"assignedBy": "user123abc",
"assignedTo": "recipient@email.com",
"time": "2024-01-01T00:00:00.000Z"
},
"_id": "nft123abc",
"attributes": [],
"created_by": "user123abc",
"description": "Example NFT description",
"history": [
{
"owner": "0xabcdef1234567890abcdef1234567890abcdef12",
"timeStamp": "2024-01-01T00:00:00.000Z"
}
],
"image": "https://example.com/nft-image.jpg",
"name": "Example NFT",
"nftCollection": "123abc456def789",
"owner": "user123abc",
"tokenId": "0",
"txn_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z",
"__v": 0,
"id": "nft123abc"
}
]
}
],
"message": "Fetched all collections successfully.",
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of apikey objects and |
| 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 Collections
This endpoint allows retrieving all collections for a specific user.
GET https://nft-platform.azurewebsites.net/api/v1/collections/user/:userId
INFO
Authentication: Requires ApiKey for authentication. Permissions: Requires USER role with read permission.
{
"collections": [
{
"_id": "67bc6994027599bc66efa5e1",
"category": "Art",
"contractAddress": "0xbb0F8319518dC500937526090FFef3f475e27d48",
"createdBy": {
"_id": "67a98689bc4810c0e57b07d7",
"accountAddress": "0x03b298945c1997ADF637fd11c3dcbA15C915B132",
"deleted": false,
"email": "dofeyax707@nike4s.com",
"orgId": "674ecdcc923de3913822c5fe",
"privateKey": "guWmmHRRSkVZ2lgnXeZW0Q==:mrtJpK4/IcHMNBjUjbKje4I3MJuLJAHINOuB1Y+8PGpJUB6ZRmV4Exb7cqKDweri52kNP+GPz3+aohEZ114dafZU",
"userId": "67a986897ab94fbb2eb0ce54",
"credits": [],
"createdAt": "2025-02-10T04:54:33.964Z",
"updatedAt": "2025-02-10T04:54:33.964Z",
"__v": 0,
"creditsRemaining": 0,
"creditsTotal": 0,
"creditsUsed": 0,
"id": "67a98689bc4810c0e57b07d7"
},
"description": "Dummy Collection",
"image": "https://nftplatform.ipfs.storage/67a986897ab94fbb2eb0ce54/35af6a41332353.57a1ce913e889.jpg",
"name": "Collection 1",
"network": "amoy",
"createdAt": "2025-02-24T12:44:04.713Z",
"__v": 0,
"nfts": []
}
]
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of apikey objects and |
| 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 Categories
This endpoint allows retrieving all categories.
GET https://nft-platform.azurewebsites.net/api/v1/collections/categories
INFO
Authentication: No authentication required. Permissions: No permissions required.
{
"collectionCategory": ["Art", "Collectible", "Domain", "Music", "Photography", "Sports", "Utility", "Virtual World"],
"message": "Fetched all categories successfully.",
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of apikey objects and |
| 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 Collection By ID
This endpoint allows retrieving a collection by its ID.
GET https://nft-platform.azurewebsites.net/api/v1/collections/:collectionId
INFO
Authentication: No authentication required. Permissions: No permissions required.
Parameters
| Parameter | Type | Description |
|---|---|---|
| collectionId | string | ID of the collection to retrieve |
{
"collection": {
"_id": "abc123def456",
"category": "Art",
"contractAddress": "0x1234567890abcdef1234567890abcdef12345678",
"createdBy": "user123",
"description": "A beautiful collection of digital art pieces showcasing unique creativity and artistic expression.",
"image": "https://example.com/collection-image.jpg",
"name": "Digital Art Collection",
"network": "ethereum",
"createdAt": "2024-01-01T12:00:00.000Z",
"__v": 0,
"nfts": [
{
"assign": {
"claim_code": {
"code": "DUMMY123CODE456"
},
"assignedBy": "user123",
"assignedTo": "collector@example.com",
"time": "2024-01-01T12:30:00.000Z"
},
"_id": "nft123",
"attributes": [],
"created_by": "user123",
"description": "A stunning digital artwork",
"history": [
{
"owner": "0xabcdef1234567890abcdef1234567890abcdef12",
"timeStamp": "2024-01-01T12:15:00.000Z"
}
],
"image": "https://example.com/artwork1.jpg",
"name": "Digital Masterpiece #1",
"nftCollection": "abc123def456",
"owner": "user123",
"tokenId": "1",
"txn_hash": "0x9876543210fedcba9876543210fedcba98765432",
"createdAt": "2024-01-01T12:30:00.000Z",
"updatedAt": "2024-01-01T12:30:00.000Z",
"__v": 0,
"id": "nft123"
},
{
"assign": {
"claim_code": {
"code": "DUMMY789CODE012"
},
"assignedBy": "user123",
"assignedTo": "artist@example.com",
"time": "2024-01-01T13:00:00.000Z"
},
"_id": "nft456",
"attributes": [],
"created_by": "user123",
"description": "An innovative digital creation",
"history": [
{
"owner": "0x1234567890abcdef1234567890abcdef12345678",
"timeStamp": "2024-01-01T12:45:00.000Z"
}
],
"image": "https://example.com/artwork2.jpg",
"name": "Digital Masterpiece #2",
"nftCollection": "abc123def456",
"owner": "user123",
"tokenId": "2",
"txn_hash": "0xfedcba0987654321fedcba0987654321fedcba09",
"createdAt": "2024-01-01T13:00:00.000Z",
"updatedAt": "2024-01-01T13:00:00.000Z",
"__v": 0,
"id": "nft456"
}
]
},
"message": "Fetched collection successfully.",
"status": "success"
}HTTP Response Codes
| Status Code | Text | Description |
|---|---|---|
| 200 | OK | With an array of apikey objects and |
| 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. |