createBadge

create a new series of Nabi Badge

🔑 Requires authentication

This operation requires Bearer Token issued from our Authentication flow appended to the request headers. Please refer to Authentication page.

Before you can mint Nabi Badges, you must first create a series of Nabi Badges, which we refer to as BadgeCollection for the rest of this documentation.

These information will be used as the Nabi Badge's NFT collection name, description and image when viewed on tonscan and other TON NFT marketplaces.

Interface

GraphQL Schema
type BadgeCollection {
  id: ID!
  name: String!
  description: String
  createdAt: DateTimeISO!
  profileId: String!
  owner: Profile
  blockTimestamp: DateTimeISO
  contractAddress: String
  metadataUri: String
  metadataS3Uri: String!
  createdBlockHash: String
  collectionImageS3Uri: String
  badges: [BadgeItem]
}

Fields:

  • contractAddress: Contract address of this Nabi Badge's NFT collection

  • metadataUri and metadataS3Uri: Location of Nabi Badge NFT collection's metadata

Related fields:

  • owner: Profile of the original creator of this series of Nabi Badge

  • badges: BadgeItems minted within this series of Nabi Badge

input CreateBadgeCollectionRequest {
  profileId: String!
  name: String!
  description: String
  collectionImageS3Uri: String!
}

type Mutation {
  createBadge(request: CreateBadgeCollectionRequest!): BadgeCollection
}

Request Input

createBadgeCollectionRequest object

  • profileId: [Required]

  • name: [Required]

    • Minimum length 4 characters, maximum 50 characters

    • Supports alphanumeric characters, hyphens - and underscores _

  • description: [Optional]

    • Accepts escaped string

  • collectionImageS3Uri: [Required] Image to be displayed as picture for NFT Collection

Operation

mutation CreateBadge {
  createBadge(
    request: {
      profileId: "0x1",
      description: "Speakers of Singapore Finance Week",
      collectionImageS3Uri: "https://www.joebrowns.co.uk/media/catalog/product/Z/L/ZL057A_1.jpg",
      name: "Singapore Finance Week Speakers"
    }
  ) {
    id
    name
    description
    profileId
    metadataUri
    metadataS3Uri
    collectionImageS3Uri
    owner {
      handle
      #... other Profile fields
    }
    # other BadgeCollection fields
  }
}

Response

JSON Response
{
  "data": {
    "createBadge": {
      "id": "d5c5185a-79ca-4df3-aa4f-52e4170c3d94",
      "name": "Singapore Finance Week Speakers",
      "profileId": "0x1",
      "metadataS3Uri": "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/39322c71-b078-4380-9035-cfb82e953e98.json",
      "metadataUri": "ar://eXcwlbsV1BiRGCsGKXa60Mj0i-xDZU0k95l_ysNwv_w/9276979d-53fe-4ce7-89a5-ab0d3292b489.json",
      "collectionImageS3Uri": "https://www.joebrowns.co.uk/media/catalog/product/Z/L/ZL057A_1.jpg",
      "owner": {
        "handle": "onCloud9"
      }
    }
  }
}

Last updated