createPost

Creates a Post publication for a profile

🔑 Requires authentication

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

Interface

GraphQL Schema
input PostCreateInput {
  profileId: String!
  content: String
  contentS3Uri: String!
  contentUri: String!
  primaryContentType: PublicationContentType!
  locale: String
  appId: String
}

type Mutation {
  createPost(input: PostCreateInput!): Post!
}

Request Inputs

PostCreateInput object

  1. profileId: [Required]

  2. content: [Optional] Text content of post

    • Accepts escaped string

  3. contentS3Uri: [Required] Centralised storage URI of post's content metadata

  4. contentUri: [Required] Decentralised storage URI of post's content metadata

  5. primaryContentType: [Required] Refer to Publication Content Metadata

  6. locale: [Optional] ISO-639-1 alpha 2 representation of locale information

  7. appId: [Optional] Client executing Post creation

Operation

GraphQL Operation
mutation CreatePost {
  createPost(
    input: {
      profileId: "0x13",
      content: "Dude, \"Attack on Titan\" was such a rollercoaster that takes you on a wild ride! Picture a world where humanity's chilling behind three ginormous walls to keep out these freaky Titans – huge humanoid monsters with a serious appetite for humans. The show's a total mix of heart-pounding action, mind-bending mysteries, and characters you'll be cheering for like they're your buddies. You'll be on the edge of your couch as the gang zips around using those crazy cool 3D maneuver gear things to slice and dice Titans. But heads up, it's not all rainbows and unicorns – there's some seriously dark stuff going on that might give you the heebie-jeebies. So if you're down for an anime that's all about survival, uncovering secrets, and watching some epic Titan takedowns, give this bad boy a shot. Just be ready for a rollercoaster that's as emotional as it is explosive! 🚀🔥",
      contentS3Uri: "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/39322c71-b078-4380-9035-cfb82e953e98.json",
      contentUri: "ar://eXcwlbsV1BiRGCsGKXa60Mj0i-xDZU0k95l_ysNwv_w/9276979d-53fe-4ce7-89a5-ab0d3292b489.json",
      locale: "US",
      primaryContentType: TEXT_ONLY
    }
  ) {
    id
    postId
    profileId
    contentS3Uri
    content
    language
    # ... any other Post fields
  }
}

Response

JSON Response
{
  "data": {
    "createPost": {
      "id": "58",
      "postId": null,
      "contractPublicationId": "0x2",
      "profileId": "0x13",
      "contentS3Uri": "https://nabi-protocol-profile-nft-meta.s3.amazonaws.com/39322c71-b078-4380-9035-cfb82e953e98.json",
      "content": "Dude, \"Attack on Titan\" was such a rollercoaster that takes you on a wild ride! Picture a world where humanity's chilling behind three ginormous walls to keep out these freaky Titans – huge humanoid monsters with a serious appetite for humans. The show's a total mix of heart-pounding action, mind-bending mysteries, and characters you'll be cheering for like they're your buddies. You'll be on the edge of your couch as the gang zips around using those crazy cool 3D maneuver gear things to slice and dice Titans. But heads up, it's not all rainbows and unicorns – there's some seriously dark stuff going on that might give you the heebie-jeebies. So if you're down for an anime that's all about survival, uncovering secrets, and watching some epic Titan takedowns, give this bad boy a shot. Just be ready for a rollercoaster that's as emotional as it is explosive! 🚀🔥"
      // ... any other Post fields
    }
  }
}

Last updated