collectPublication

Collect a single Publication

🔑 Requires authentication

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

When a Profile collects a publication, the collected Publication will mint a Publication NFT Collection (if one does not exist yet), then performs a NFT item mint to complete the Collect.

Only POST can be collected at this time

Interface

GraphQL Schema
type Collect {
  id: ID!
  createdAt: DateTimeISO!
  profileId: String!
  publicationId: String
  metadataUri: String
  metadataS3Uri: String!
  publicationType: PublicationType!
  publicationCollectionNftAddress: String
  collectId: String
  contractItemId: String
  nftTokenId: String
  nftChainId: Int
  blockTimestamp: DateTimeISO
  createdBlockHash: String
  publication: Publication
}

enum PublicationType {
  POST
  # COMMENT
  # MIRROR
}

Fields:

  • metadataUri and metadataS3Uri: The location of the Collect NFT item's metadata

  • publicationType: Refers to the type Publication that is being collected

  • publicationCollectionNftAddress: The collected Publication's NFT Collection contract address

  • collectId:

GraphQL Schema
input CollectPublicationRequest {
  profileId: String!
  publicationType: PublicationType!
  publicationId: String!
}

type Mutation {
  collectPublication(request: CollectPublicationRequest!): Collect
}

Request input

CollectPublicationRequest object

  1. profileId: [Required] Collector's profileId

  2. publicationType: [Required] Type of Publication

  3. publicationId: [Required] postId or commentId

Operation

GraphQL Operation
mutation collectPublication {
  collectPublication(
    request: {
      profileId: "0x20",
      publicationType: POST,
      publicationId: "0x22-0x0"
    }
  ) {
    id
    profileId
    publicationType
    publicationCollectionNftAddress
    collectId
    # ... other Collect fields
  }
}

Response

JSON Response
{
  "data": {
    "collectPublication": {
      "id": "d5c5185a-79ca-4df3-aa4f-52e4170c3d94",
      "profileId": "0x10",
      "publicationType": "POST",
      "publicationCollectionNftAddress": null,
      "collectId": null
    }
  }
}

Last updated