Modules
Guestbook Events

Guestbook Events

Guestbook Events are ERC1155 tokens that represent attendance at a specific event, or an interaction with a physical product.

Deploy a Guestbook Contract

Creates a new guestbook contract.

Request

POST /events/contracts

Headers

HeaderValueRequired
content-typeapplication/jsonYes
x-iyk-api-keyAPI key for userYes

Body

FieldDescriptionType
nameName for the contractstring
symbolSymbol for the contractstring
chainIdThe chain ID where the contract is deployednumber

Response

{
  "success": true,
  "contractId": 123
}
FieldDescriptionType
successIndicates if the request was successfulboolean
contractIdThe unique identifier of the created contractnumber

Get Guestbook Contracts for a Team

Retrieves all guestbook contracts associated with a team.

Request

GET /events/contracts

Headers

HeaderValueRequired
x-iyk-api-keyAPI key for userYes

Response

Returns an array of contract objects.

FieldDescriptionType
idUnique identifier of the contractnumber
nameName of the contractstring
symbolSymbol of the contractstring
addressContract addressstring | null
chainIdContract chain IDnumber
createdAtContract creation timestampstring
statusDeployment status of the contract"pending" | "confirmed"

Example Response

[
    {
        "id": 123,
        "name": "TEST",
        "symbol": "TEST",
        "address": null,
        "chainId": 137,
        "createdAt": "2024-02-07T21:39:01.012Z",
        "status": "pending"
    },
    ...
]

Metadata Structure for Guestbook Events

The below structure is used to define the metadata when creating or updating a guestbook event's associated token. All fields are based on the OpenSea Metadata Standard (opens in a new tab).

Metadata Fields

FieldDescriptionTypeRequired
nameThe name of the eventstringYes
collectionThe collection to which the event belongsstringYes
descriptionThe description of the eventstringYes
imageURL pointing to an image associated with the eventstringYes
attributesList of attributes for the eventArray<Attribute>Yes

Attribute Object Structure

Each attribute within the attributes array should follow this structure:

FieldDescriptionTypeRequired
trait_typeThe name of the attributestringYes
valueThe value of the attributestring | numberYes
display_typeThe display type of the attribute (optional, refer to OpenSea standard)string?No

Example Metadata JSON

An example of how to format the metadata JSON string for a guestbook event:

{
  "name": "Conference 2024",
  "collection": "Conferences",
  "description": "A gathering of professionals to discuss industry trends.",
  "image": "https://example.com/image.png",
  "attributes": [
    {
      "trait_type": "Location",
      "value": "New York"
    },
    {
      "trait_type": "Date",
      "value": "2024-05-20"
    },
    {
      "trait_type": "Attendees",
      "value": 500,
      "display_type": "number"
    }
  ]
}

Create a Guestbook Event

Creates a new guestbook event for a specified guestbook contract.

Request

POST /events

Headers

HeaderValueRequired
content-typeapplication/jsonYes
x-iyk-api-keyAPI key for userYes

Body

FieldDescriptionType
namePrivate label for the eventstring
tokenIdToken ID associated with the eventstring
contractIdID of the guestbook contractstring
metadataJSON string containing the token metadata (refer to metadata structure)string

Example Body

{
  "name": "TEST Event 3",
  "tokenId": "3",
  "contractId": 121,
  "metadata": "{\"name\":\"AnnualConference\",\"collection\":\"Conferences\",\"description\":\"Agatheringofprofessionalstodiscussindustrytrends.\",\"image\":\"https://example.com/image.png\",\"iyk_metadata_version\":\"1.0\",\"attributes\":[{\"trait_type\":\"Location\",\"value\":\"NewYork\"},{\"trait_type\":\"Date\",\"value\":\"2024-05-20\"},{\"trait_type\":\"Attendees\",\"value\":500,\"display_type\":\"number\"}]}"
}

Response

FieldDescriptionType
successIndicates if the request was successfulboolean
idThe unique identifier of the created eventnumber

Example Response

{
  "success": true,
  "id": 123
}

Get Guestbook Events for a Team

Retrieves all guestbook events associated with the user's team.

Request

GET /events

Headers

HeaderValueRequired
x-iyk-api-keyAPI key for userYes

Query Parameters

FieldTypeDescriptionRequired
contractIdnumberThe contract ID to filter forNo*

Response

Returns an array of event objects, including details and contract information.

FieldDescriptionType
idUnique identifier of the eventnumber
nameName of the eventstring
contractObject containing contract detailsobject
contract.idID of the associated contractnumber
contract.addressContract addressstring
contract.chainIdBlockchain chain IDnumber
contract.tokenIdToken ID associated with the eventstring
createdAtCreation timestampstring

Example Response

[
    {
        "id": 92,
        "name": "TEST Event 1",
        "contract": {
            "id": 121,
            "contractAddress": "0x8a7eacf921a11c078ca9e873921da3bcdedf6e70",
            "chainId": 137,
            "tokenId": "1"
        },
        "createdAt": "2024-02-08T03:55:32.372Z"
    }
    ...
]

Update Metadata for a Guestbook Event

Updates the metadata for a specified guestbook event.

Request

PATCH /events/metadata

Headers

HeaderValueRequired
content-typeapplication/jsonYes
x-iyk-api-keyAPI key for userYes

Body

FieldDescriptionType
eventId(Optional) ID of the event to updatestring
tokenIdToken ID, required if eventId is not providedstring
contractAddressContract address, required if eventId is not providedstring
chainIdChain ID, required if eventId is not providednumber
metadataJSON string containing the new metadata (refer to metadata structure)string

Example Body

{
  "contractId": 121,
  "tokenId": "1",
  "name": "TEST Event 1",
  "metadata": "{\"name\":\"DEV CHIP #1\",\"description\":\"For development purposes.\",\"image\":\"https://files.iyk.app/products/18e8e5f3-ee04-4170-a7ea-afb943369a10/iyk_black_shirt.mp4\",\"attributes\":[{\"trait_type\":\"Purpose\",\"value\":\"Development\"}],\"collection\":\"DEV\",\"media_gallery\":[]}"
}

Response

FieldDescriptionType
successIndicates if the request was successfulboolean

Example Response

{
  "success": true
}

Mint for a Guestbook Event

Mints a token for a specified guestbook event.

Request

POST /events/mint

Headers

HeaderValueRequired
content-typeapplication/jsonYes
x-iyk-api-keyAPI key for userYes

Body

FieldDescriptionType
eventId(Optional) ID of the event to mint forstring
tokenIdToken ID, required if eventId is not providedstring
contractAddressContract address, required if eventId is not providedstring
chainIdChain ID, required if eventId is not providednumber
recipientAddress of the recipientstring

Response

FieldDescriptionType
successIndicates if the request was successfulboolean
txnHashTransaction hash of the mint operationstring

Example Response

{
  "success": true,
  "txnHash": "transaction_hash"
}

I'll add the documentation for the new mint/self function.


Mint for a Guestbook Event (Self)

Mints a token for a specified guestbook event using the claim code.

Request

POST /events/mint/self

Headers

HeaderValueRequired
content-typeapplication/jsonYes
x-iyk-codeOTP code for guestbook eventYes

Body

FieldDescriptionType
recipientETH address or ENS name of the recipientstring

Example Body

{
  "recipient": "0xRecipientAddressOrENSName"
}

Response

FieldDescriptionType
successIndicates if the request was successfulboolean
txnHashTransaction hash of the mint operationstring

Example Response

{
  "success": true,
  "txnHash": "transaction_hash"
}

Assign Guestbook Event to Tag (Legacy)

Assigns a guestbook event to specified tags.

Request

POST /events/assign/legacy

Headers

HeaderValueRequired
content-typeapplication/jsonYes
x-iyk-api-keyAPI key for userYes

Body

FieldDescriptionType
tagUIDsList of tag UIDs to assign the eventstring[]
guestbookEventIdID of the guestbook event to assignnumber

Example Body

{
  "tagUIDs": ["tagUID1", "tagUID2"],
  "guestbookEventId": 123
}

Response

FieldDescriptionType
successIndicates if the request was successfulboolean

Example Response

{
  "success": true
}

Certainly! I'll add the documentation for the POST /toggle-pause-state endpoint to your existing documentation. Here's the new section to be added:


Toggle Transfer Pause State for a Guestbook Contract

Toggles the pause state for transfers on a specified guestbook contract. If pauseState is true, transfers will be paused (soulbound).

Request

POST /events/toggle-pause-state

Headers

HeaderValueRequired
content-typeapplication/jsonYes
x-iyk-api-keyAPI key for userYes

Body

FieldDescriptionType
contractIdID of the guestbook contract (optional if address is provided)number
contractAddressAddress of the guestbook contract (optional if ID is provided)string
chainIdChain ID of the contract (required if address is provided)number
pauseStateThe desired pause state (true to pause, false to unpause)boolean

Note: Either contractId or both contractAddress and chainId must be provided.

Example Body

{
  "contractId": 123,
  "pauseState": true
}

Response

FieldDescriptionType
successIndicates if the request was successfulboolean
txnHashTransaction hash of the toggle pause state actionstring

Example Response

{
  "success": true,
  "txnHash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
}