Chat API

This is just a stub page.

The hub server has a built-in API for a simple chat system.

There are two types of messages:

  • User messages: messages posted by a user thus can be displayed like foo1: Hello world!
  • System messages: announcements from the server like foo1 just won the 5 BTC jackpot!

Post a user message as the current user

mutation CreateChatUserMessage {
  hubChatCreateUserMessage(input: { clientId: UUID!, body: String! }) {
    chatUserMessage {
      id
    }
  }
}

Creates a message in the current experience’s chat as the current user.

To avoid double submissions, the client sends a unique clientId UUID for each message.

This can only be used by session:{sessionKey} authenticated requests.

Post a system message

mutation CreateChatSystemMessage {
  hubChatCreateSystemMessage(input: { clientId: UUID!, body: String!, experienceId: UUID! }) {
    chatSystemMessage {
      id
    }
  }
}

This can be used by apikey:{apiKey} operator requests or by session:{sessionKey} requests if the current user is the experience’s owner.

Mute user

TODO

Unmute user

TODO

Promote/demote chat moderators

TODO