NMKR Docs
ProductsContact
English
English
  • Welcome to NMKR Docs
  • Introduction
    • About NMKR
    • Powered by NMKR
    • What is an NFT?
      • What is IPFS?
    • Why Cardano?
  • NMKR Studio
    • Introduction - NMKR Studio
    • Features Overview
    • 🖥️Learn NMKR Studio in 3 minutes
      • Basic Workflow
    • How to - Quick Start Tutorials
      • Quickstart Full Video Tutorial
      • Guidelines Planning a Project
      • How To Add Tokens
      • How to set up Metadata
      • How To Sell Tokens
      • How To Set Up Sales Conditions
      • How To Do a Reveal
      • How To Burn Tokens
      • How To Enable Royalties
      • How To Enable DIDs
      • How To Set up Whitelisting
      • How to Airdrop Tokens
    • Pricing
    • Account
      • Registration & KYC
      • Security
      • Wallets
      • Mint Coupons
      • Dashboard
      • Transactions
      • Invoices
      • API Keys
    • Project
      • Policy
        • Managing policies
      • Create
      • Edit
      • Metadata Template
      • Statistics
      • DID - Decentralized Identifier
      • Notifications
      • Royalties
      • Additional Payout Wallets
      • Affiliate links
      • Export Metadata as Zip
      • Export NFT as csv
      • Mint and Send Jobs
      • Export placeholder.csv
    • Token
      • Manage Tokens Tab
      • Upload
        • Upload single tokens
        • Bulk Upload Files and Metadata
          • Bulk Upload via Drag and Drop
          • Bulk upload via SFTP
      • Edit
      • Metadata
        • Add Token-specific Metadata
        • Fingerprint (Metadata preview)
        • Metadata Check
        • Metadata Standard for fungible Tokens
        • Fully on-Chain NFTs
          • Partial URL-Encoding
        • CIP-68
      • Duplicate
      • Delete
      • Burn
      • Update (Edit after Mint / Reveal)
    • Set up Sales
      • Manage prices / Pricelist
        • Create new Prices
        • Free Drops
        • Custom Token payment
        • Discounts
      • Sales Conditions & Whitelisting
        • Sales conditions depending on policy ID or stake pool
        • Whitelist with Count
        • Blacklist
        • Test Sales Condition
      • Block Tokens
      • NMKR Pay
        • Set up NMKR Pay
        • MultiSig Payment
        • Website Integration
        • Specific Payment Links
        • Manual sending in NMKR Pay
        • FIAT ETH and SOL Payment
      • Pay-In Address
      • Auction
    • Minting
      • Minting on Demand
      • Manual Minting
      • Airdropper
        • Airdrop with random distribution
        • Airdrop with specific distribution
    • Tools
      • Managed Wallets
      • Split Addresses
      • Direct Sales
      • Policy Snapshot
      • Integrations & Plugins
        • NFT Pal
        • Zapier
    • Testnet
      • Create Testnet Account
      • Testnet Wallet & tADA
      • Testnet API Swagger
  • NMKR Studio API
    • Introduction - NMKR Studio API
    • API Features
    • Swagger API Endpoints
    • Get started with the API
    • API Swagger
      • Get Started with the Swagger
      • Swagger Responses and Error Codes
    • API Examples
      • Users
        • Payout Wallets
        • Subcustomers
      • Project
        • Create Project
        • Upload File and Metadata
      • Payment
        • Create unique NMKR Pay Link for random Token sales
        • Create NMKR Pay Link for specific Token sales
        • Get Payment Address for single NFT sales with native Tokens
        • Create NMKR Pay Link for a multi-specific Tokens sale
      • Minting
        • Manual Minting
      • Smart Contract
        • Secondary Sales via NMKR Pay
    • API Open Source Contributions
  • NMKR Mint
    • Introduction - NMKR Mint
    • Mint single NFTs
    • Mint Collection
  • NMKR Playground
    • Introduction - NMKR Playground
    • ADA Payment Link
    • Paperwallet
  • NMKR Pool
    • What is Staking?
    • Stake with NMKR Pool
  • Helpful Links
    • Cardano NFT Ressources
    • Cardano Resources
    • Cardano Wallets
    • Open Source Repositories
    • Security Practices
    • Deal with Bots
Powered by GitBook
On this page
  1. NMKR Studio API
  2. API Examples
  3. Project

Upload File and Metadata

Upload a file to your project

PreviousCreate ProjectNextPayment

With the following endpoint, you are able to upload a token and optional to also define placeholder values or also a complete metadata code for the metadata override.

Please keep in mind that if you upload the metadata in a payload, the metadata must be escaped.

Endpoint

/v2/UploadNft

Body

Define the body for the request fitting for your token upload. Please remove the fields that don't apply for your upload. You have the option of uploading the file as BASE64 Content, URL Link, or IPFS Hash. If you submit Metadata, it will be used instead of the project's Metadatatemplate. You may submit either Metadata or MetadataPlaceholder, but not both.

{
  "tokenname": "string",
  "displayname": "string",
  "description": "string",
  "previewImageNft": {
    "mimetype": "string",
    "fileFromBase64": "string",
    "fileFromsUrl": "string",
    "fileFromIPFS": "string"
  },
  "subfiles": [
    {
      "subfile": {
        "mimetype": "string",
        "fileFromBase64": "string",
        "fileFromsUrl": "string",
        "fileFromIPFS": "string"
      },
      "description": "string",
      "metadataPlaceholder": [
        {
          "name": "string",
          "value": "string"
        }
      ]
    }
  ],
  "metadataPlaceholder": [
    {
      "name": "string",
      "value": "string"
    }
  ],
  "metadataOverride": "string",
  "priceInLovelace": 0
}

For this example, we specified the body like that:

{
  "tokenname": "thetoken1",
  "displayname": "The Token 1",
  "description": "This is a test",
  "previewImageNft": {
    "mimetype": "image/png",
    "fileFromIPFS": "QmfA66piVcujJoSmL1fu1beJS2agvadXbzwv4hX4dnzqWY"
  },
  "subfiles": [
    {
      "subfile": {
        "mimetype": "image/png",
        "fileFromIPFS": "QmPep292dYH9CXH9AcMgbcEohXUc3P8ERbAfw7r9HM3AdY"
      }
    }
  ],
  "metadataPlaceholder": [
    {
      "name": "background",
      "value": "green"
    }
  ]
}

Curl

curl -X 'POST' \
  'https://studio-api.nmkr.io/v2/UploadNft/1420d55a-e194-4aa6-b57d-6d0f0d3b0738' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer 1ac2cb0abea146f7bb8a90701dad311c' \
  -H 'Content-Type: application/json' \
  -d '{
  "tokenname": "thetoken1",
  "displayname": "The Token 1",
  "description": "This is a test",
  "previewImageNft": {
    "mimetype": "image/png",
    "fileFromIPFS": "QmfA66piVcujJoSmL1fu1beJS2agvadXbzwv4hX4dnzqWY"
  },
  "subfiles": [
    {
      "subfile": {
        "mimetype": "image/png",
        "fileFromIPFS": "QmPep292dYH9CXH9AcMgbcEohXUc3P8ERbAfw7r9HM3AdY"
      }
    }
  ],
  "metadataPlaceholder": [
    {
      "name": "background",
      "value": "green"
    }
  ]
}'

Response

{
  "nftId": 13174329,
  "nftUid": "8deedfd7-6aa4-45df-be6b-27efa51b8ec3",
  "ipfsHashMainnft": "QmfA66piVcujJoSmL1fu1beJS2agvadXbzwv4hX4dnzqWY",
  "ipfsHashSubfiles": [
    "QmPep292dYH9CXH9AcMgbcEohXUc3P8ERbAfw7r9HM3AdY"
  ],
  "metadata": "{\n  \"721\": {\n    \"63cb7af8c980f0867940e765f36fa53ac948d9af51179742291a553e\": {\n      \"thetoken1\": {\n        \"name\": \"The Token 1\",\n        \"image\": \"ipfs://QmfA66piVcujJoSmL1fu1beJS2agvadXbzwv4hX4dnzqWY\",\n        \"mediaType\": \"image/png\",\n        \"description\": \"This is a test\",\n        \"files\": [\n          {\n            \"name\": \"The Token 1\",\n            \"mediaType\": \"image/png\",\n            \"src\": \"ipfs://QmPep292dYH9CXH9AcMgbcEohXUc3P8ERbAfw7r9HM3AdY\"\n          }\n        ]\n      }\n    },\n    \"version\": \"1.0\"\n  }\n}",
  "assetId": "63cb7af8c980f0867940e765f36fa53ac948d9af51179742291a553e746865746f6b656e31"
}

Using the Metadata Override instead of the Placeholder

In case you want to submit a complete 721 Metadata JSON, please keep in mint that you have to remove the MetadataPlaceholder fields in the request body and use the Metadata override field.

  "metadataOverride": "string",

Continue to send your Curl as you would with the placeholder method, adding the escaped metadata to the field:

  "metadataOverride": "{\r\n  \"721\": {\r\n    \"63cb7af8c980f0867940e765f36fa53ac948d9af51179742291a553e\": {\r\n      \"thetoken1\": {\r\n        \"name\": \"The Token 1\",\r\n        \"image\": \"ipfs:\/\/QmfA66piVcujJoSmL1fu1beJS2agvadXbzwv4hX4dnzqWY\",\r\n        \"mediaType\": \"image\/png\",\r\n        \"background\": \"green\",\r\n        \"description\": \"This is a test\",\r\n        \"files\": [\r\n          {\r\n            \"name\": \"The Token 1\",\r\n            \"mediaType\": \"image\/png\",\r\n            \"src\": \"ipfs:\/\/QmPep292dYH9CXH9AcMgbcEohXUc3P8ERbAfw7r9HM3AdY\"\r\n          }\r\n        ]\r\n      }\r\n    },\r\n    \"version\": \"1.0\"\r\n  }\r\n}",

Instead of giving the metadata via MetadataOverride, we used the metadataPlaceholder method to define custom fields. Please keep in mind that this placeholder method only works, if the custom fields are specified in the . If you want to use the Metadata Override, .

Online JSON Escape /Unescape Tool
https://www.freeformatter.com/json-escape.html#before-output
metadata template
please read here