Retrieve Token-type (NFT template)

How to retrieve an NFT token type (template) from one of your contracts.

This API endpoint allows users to fetch detailed information about a specific NFT token type, also referred to as an NFT template, from one of the NFT contracts. Additionally, you can also retrieve all NFT token types associated with an NFT contract.

1. Get NFT template (token-type) by tokenTypeId

Request Endpoint: reference

GET /api/v2/contracts/{secretType}/{contractAddress}/token-types/{tokenTypeId}
ParameterParam TypeDescriptionData TypeMandatory
{secretType}PathThe blockchain of the contract.Stringโœ…
{contractAddress}PathThe contract address whose token-type you want to fetch.Stringโœ…
{tokenTypeId}PathThis is the id of the token-type.Stringโœ…

Example Request:

GET /api/v2/contracts/MATIC/0x30d6cff9cb268c59c75a94755b2c60e118d65657/token-types/1

Response Body:

{
    "success": true,
    "result": {
        "secretType": "MATIC",
        "contractAddress": "0x30d6cff9cb268c59c75a94755b2c60e118d65657",
        "tokenTypeId": 1,
        "onChainStatus": "SUCCEEDED",
        "metadata": {
            "name": "My first NFT",
            "description": "Venly",
            "image": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/StickFigureHi.png",
            "imagePreview": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/StickFigureHi.png",
            "imageThumbnail": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/StickFigureHi.png",
            "animationUrls": [],
            "attributes": [
                {
                    "type": "system",
                    "name": "tokenTypeId",
                    "value": "1",
                    "traitType": "Token Type ID",
                    "trait_type": "Token Type ID"
                }
            ],
            "contract": {
                "address": "0x30d6cff9cb268c59c75a94755b2c60e118d65657",
                "name": "My first collection",
                "symbol": "MYFICO",
                "image": "https://pbs.twimg.com/profile_images/1669300450649157635/4xg-wsbK_400x400.jpg",
                "imageUrl": "https://pbs.twimg.com/profile_images/1669300450649157635/4xg-wsbK_400x400.jpg",
                "image_url": "https://pbs.twimg.com/profile_images/1669300450649157635/4xg-wsbK_400x400.jpg",
                "description": "Sample description",
                "externalLink": "www.venly.io",
                "external_link": "www.venly.io",
                "externalUrl": "www.venly.io",
                "external_url": "www.venly.io",
                "media": [],
                "type": "ERC_1155"
            },
            "fungible": false
        }
    }
}

2. Get all NFT templates (token-types)

Request Endpoint: reference

GET /api/v2/contracts/{secretType}/{contractAddress}/token-types
ParameterParam TypeDescriptionData TypeMandatory
{secretType}PathThe blockchain of the contract.Stringโœ…
{contractAddress}PathThe contract address whose token-types you want to fetchStringโœ…

Example Request:

GET /api/v2/contracts/MATIC/0x30d6cff9cb268c59c75a94755b2c60e118d65657/token-types

Response Body:

{
    "success": true,
    "result": [
        {
            "secretType": "MATIC",
            "contractAddress": "0x30d6cff9cb268c59c75a94755b2c60e118d65657",
            "tokenTypeId": 1,
            "name": "My first NFT",
            "image": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/StickFigureHi.png",
            "imagePreview": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/StickFigureHi.png",
            "imageThumbnail": "https://storage-qa.venly.io/applications/1f64ded9-2a05-4824-b682-661023359357/StickFigureHi.png",
            "fungible": false,
            "onChainStatus": "SUCCEEDED"
        }
    ]
}