Skip to content
This repository has been archived by the owner on May 13, 2020. It is now read-only.

API Reference [experimental]

Marcel Koch edited this page Oct 30, 2019 · 6 revisions

User Endpoints

/channel/list

Get all channels.

No parameters

Response:

  • success:
{
  "channels": [
    {
      "uuid": "<uuid of the channel [string, uuid]>",
      "name": "<name of the channel [string]>"
    }
  ]
}

/channel/members

Get all members in a channel.

Required parameters:

  • channel: uuid of the channel [string, uuid]

Response:

  • success:
{
  "users": [
    {
      "name": "<name of the user [string]>"
    }
  ]
}
  • the channel does not exist:
{
  "error": "channel_not_found"
}

/channel/join

Join into a channel.

Required parameters:

  • channel: uuid of the channel [string, uuid]

Response:

  • success:
{
  "success": true
}
  • the channel does not exist:
{
  "error": "channel_not_found"
}
  • the user does not exist:
{
  "error": "user_not_found"
}

/channel/leave

Leave from a channel.

Required parameters:

  • channel: uuid of the channel [string, uuid]

Response:

  • success:
{
  "success": true
}
  • the user is not in the channel:
{
  "success": "false"
}
  • the channel does not exist:
{
  "error": "channel_not_found"
}
  • the user does not exist:
{
  "error": "user_not_found"
}

/message/send

Send a message.

Required parameters:

  • channel: uuid of the channel [string, uuid]
  • message: content of the message [string]

Response:

  • success:
{
  "success": true
}
  • the channel does not exist:
{
  "error": "channel_not_found"
}

/message/whisper

Whisper a message.

Required parameters:

  • channel: uuid of the channel [string, uuid]
  • message: content of the message [string]
  • target: name of the target user [string]

Response:

  • success:
{
  "success": true
}
  • the channel does not exist:
{
  "error": "channel_not_found"
}
  • the user does not exist:
{
  "error": "user_not_in_channel"
}