Niftory Docs
  • What is Niftory?
  • Get your API Keys
  • 👩‍💻API
    • Niftory Web3 API
    • SDK QuickStart
      • Using the SDK in React
      • Using the SDK from the Server
    • API Quickstart
      • Create your first Wallet
      • API calls with Sample Content
      • Mint your first NFT
    • API Cheat Sheet
    • Niftory Sample App
      • Explore the Sample App
      • Anatomy of a Niftory App
        • Getting Authenticated
        • GraphQL Client Setup
        • API Usage
        • Transfer an NFT
    • 💡Core Concepts
      • Niftory Data Model
      • Authentication
        • Using Your API Key
        • Configuring Your App
        • Privileged Authentication
      • App and AppUser
      • NFTs
        • Creating NFTs
        • Querying NFTs
        • Transferring NFTs
        • Minting NFTs
      • Wallets
        • Create a Niftory Wallet
        • Register External Wallets
        • Query Wallets
      • Contract
      • User Auth (Client-Side)
    • Your Niftory Account
  • 🧑‍💼Admin Portal
    • Niftory Admin Portal
    • 🚀Guides
      • Setting Up Your Org
      • Create Your First NFT
    • 🗺️Explore
      • Org and Apps
      • NFT Collection
        • Sets
        • Collectibles
        • NFTs
    • 💼Use Cases
      • For Engineers
      • For Designers
      • For Business Users
  • 📖Reference
    • GraphQL & Auth Endpoints
    • API Reference
    • SDK API Reference
Powered by GitBook
On this page
  • Create NFTSet
  • Upload NFTContent
  • Create NFTModel

Was this helpful?

  1. API
  2. Core Concepts
  3. NFTs

Creating NFTs

PreviousNFTsNextQuerying NFTs

Last updated 1 year ago

Was this helpful?

To create NFT content in a no-code manner, use the -- the same place you got your API keys from. Follow this .

To create NFT content using the API, follow the steps below:

Create

mutation CreateSet($data: NFTSetCreateInput!) {
    createNFTSet(data: $data) {
        id
        title
        attributes
    }
}

Example args:

{
    "data": {
        "title": "My Set",
        "attributes": {
            "properties": {
                "that": "are private to your app",
                "and": "don't get added to the blockchain"
            }
        }
    }
}

There are two ways to upload content for your NFT. In both cases, Niftory provides you with pre-signed URLs to upload NFT content to.

Once you upload content to the pre-signed URL, by default Niftory automatically schedules upload to IPFS asynchronously.

This API creates an NFTContent object in the database, and sets the URL's to pre-signed URLs that you can upload a file and a corresponding poster to.

mutation UploadNFTContent($name: String!, $description: String) {
    uploadNFTContent(name: $name, description: $description) {
        id
        files {
            id
            state
            name
            url
        }
        poster {
            id
            state
            url
        }
    }
}
{
    "name": "Test file",
    "description": "This is a test file"
}

This gives a bit more control on what to upload. For e.g, if you just want to upload a file, but no corresponding poster, then this API is a good way to do that.

You can also use this to just upload files without scheduling an IPFS upload. That can be achieved as follows:

mutation CreateFileUploadUrl($name: String!, $description: String, $options: CreateFileOptionsInput!) {
    createFileUploadUrl(name: $name, description: $description, options: $options) {
        id
        name
        url
        state
    }
}
{
    "name": "Test file",
    "description": "This is a test file",
    "options": {
        "uploadToIPFS": false
    }
}

You can upload the files asynchronously. That is, you can continue on to create an NFTModel before actually uploading the file.

Finally, use the id of the NFTSet you created, as well as the id of the NFTContent to create an NFTModel:

mutation CreateModel($setId: ID!, $data: NFTModelCreateInput!) {
    createNFTModel(setId: $setId, data: $data) {
        id
        quantity
        title
        attributes
    }
}
{
    "setId": "f29f68ac-43a2-46da-b56b-01e3423719f5",
    "data": {
        "title": "My NFTModel",
        "description": "My NFT template",
        "quantity": 5,
        "contentId": "be040196-421c-48a8-8749-44edc7a92cdd",
        "metadata": {
            "this": "ends up on the blockchain"
        },
        "attributes": {
            "properties": {
                "that": "are private to your app",
                "and": "don't get added to the blockchain"
            }
        }
    }
}

And voila, you have your NFTModel!

If not already done so, create an NFTSet using the API.

Upload

Create

👩‍💻
💡
createNFTSet
Try it out in Postman
NFTContent
uploadNFTContent
Try it out in Postman
createFileUploadUrl
Try it out in Postman
NFTModel
Try it out in Postman
Niftory Admin Portal
guide for reference
NFTSet
Create Your First NFTNiftory Docs
Logo