Rheel Chat API (1.0.1)

Download OpenAPI specification:

License: MIT

RheelのChat API仕様です。主に以下の2種類のエンドポイントを提供し、 認証方式によって利用方法が異なります。

  1. Server Request 管理者(あるいはバックエンドサーバー)が、管理画面で発行したアプリケーション独自のAPI Key を用いた、ユーザー管理 (ユーザー作成・削除など) やセッショントークンの発行などを行う際のエンドポイントです。

  2. User Request セッショントークン発行のエンドポイントを介して取得したセッショントークンを用いた、メッセージの投稿やチャンネルの閲覧・参加などのエンドポイントです。

ユーザーリクエストとサーバーリクエストの概念図


認証の流れ

  1. 管理画面からアプリケーション独自の API Key を取得します。 これはサーバーサイド(管理系)の認証に使用します。

  2. エンドユーザーがログインすると、上記の API Key を用いてユーザーごとに セッショントークンを発行します。

  3. ユーザーは、フロントエンド (Web クライアントやモバイルアプリなど) から セッショントークンを利用してチャットサービスにアクセスし、メッセージの送受信や チャンネルの閲覧・参加を行います。

Webhookのイベントやユーザーの作成・削除、権限管理などについて、詳しくはヘルプページをご覧ください。

Users

ユーザー一覧の取得

ユーザー一覧を取得します。

Authorizations:
ServerApiKeyAuth
query Parameters
limit
integer <int32>
Default: 20
offset
integer <int32>
Default: 0

Responses

Response samples

Content type
application/json
{
  • "users": [
    ],
  • "totalCount": 0
}

ユーザーの作成

新規ユーザーを作成します。

Authorizations:
ServerApiKeyAuth
Request Body schema: application/json
required
id
string [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

ユーザーの一意な識別子(指定しない場合は自動生成されます)

display_name
required
string [ 1 .. 200 ] characters

ユーザーの表示名

icon_url
string or null

ユーザーアイコンのURL

role
required
string
Enum: "Admin" "Member"

ユーザーの権限・役割(Admin:管理者, Member:一般ユーザー)

object or null

任意の追加メタデータ

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "display_name": "string",
  • "icon_url": "string",
  • "role": "Admin",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "display_name": "string",
  • "icon_url": "string",
  • "role": "Admin",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "metadata": {
    }
}

ユーザーの削除

指定したユーザーを削除します。

Authorizations:
ServerApiKeyAuth
path Parameters
user_id
required
string (UserId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

Responses

Response samples

Content type
application/json
{
  • "success": true
}

ユーザー情報の更新

指定したユーザー情報を編集します。

Authorizations:
ServerApiKeyAuth
path Parameters
user_id
required
string (UserId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$
Request Body schema: application/json
required
display_name
required
string [ 1 .. 200 ] characters

ユーザーの表示名

icon_url
string or null

ユーザーアイコンのURL

role
required
string
Enum: "Admin" "Member"

ユーザーの権限・役割(admin:管理者, member:一般ユーザー)

object or null

任意の追加メタデータ

Responses

Request samples

Content type
application/json
{
  • "display_name": "string",
  • "icon_url": "string",
  • "role": "Admin",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "display_name": "string",
  • "icon_url": "string",
  • "role": "Admin",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "metadata": {
    }
}

セッショントークンの破棄

指定したユーザーのセッショントークンを破棄します。

Authorizations:
ServerApiKeyAuth
path Parameters
user_id
required
string (UserId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

Responses

Response samples

Content type
application/json
{
  • "success": true
}

セッショントークンの発行

指定したユーザーに対してセッショントークンを発行します。

Authorizations:
ServerApiKeyAuth
path Parameters
user_id
required
string (UserId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$
Request Body schema: application/json
required
expired_at
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "expired_at": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "token": "string",
  • "expired_at": "2019-08-24T14:15:22Z"
}

Channels

チャンネルリストの取得

すべてのチャンネルの一覧を取得します。

Authorizations:
ServerApiKeyAuth
query Parameters
name
string

チャンネル名で検索(部分一致)

channel_type
string (Channels.ChannelType)
Enum: "Public" "Secret"

チャンネルタイプで検索

include_archived
boolean
Default: false

アーカイブ済みチャンネルを含めるかどうか(デフォルト: false)

limit
integer <int32>
Default: 20

取得件数の上限(デフォルト: 20)

offset
integer <int32>
Default: 0

取得開始位置(デフォルト: 0)

Responses

Response samples

Content type
application/json
{
  • "channels": [
    ],
  • "totalCount": 0
}

チャンネルの作成

新規チャンネルを作成します。

Authorizations:
ServerApiKeyAuth
Request Body schema: application/json
required
id
string [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

チャンネルID(任意のIDを指定できます。指定しない場合は自動生成されます)

name
required
string [ 1 .. 200 ] characters

チャンネル名

channel_type
required
string
Enum: "Public" "Secret"

公開チャンネルか秘密チャンネルか

object or null

任意の追加メタデータ

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "channel_type": "Public",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "channel_type": "Public",
  • "metadata": {
    },
  • "is_archived": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

チャンネルの削除

指定したチャンネルを削除します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

削除対象のチャンネルID

Responses

Response samples

Content type
application/json
{
  • "success": true
}

チャンネル詳細の取得

指定したチャンネルの詳細情報を取得します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

取得対象となるチャンネルのID

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "channel_type": "Public",
  • "metadata": {
    },
  • "is_archived": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "latest_message": {
    }
}

チャンネルの編集

指定チャンネルの名称・属性などを編集します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

編集対象チャンネルのID

Request Body schema: application/json
required
name
required
string [ 1 .. 200 ] characters

チャンネル名

channel_type
required
string
Enum: "Public" "Secret"

公開チャンネルか秘密チャンネルか

object or null

任意の追加メタデータ

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "channel_type": "Public",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "id": "string",
  • "name": "string",
  • "channel_type": "Public",
  • "metadata": {
    },
  • "is_archived": true,
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z"
}

チャンネルのアーカイブ

指定したチャンネルをアーカイブします。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

アーカイブするチャンネルID

Responses

Response samples

Content type
application/json
{
  • "success": true
}

チャンネルからのユーザー追放

指定チャンネルからユーザーを追放します(roleがadminの場合のみ削除可能)。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

ユーザーを追放するチャンネルID

Request Body schema: application/json
required
user_ids
required
Array of strings non-empty

削除するユーザーIDの配列(最低1件以上必要)

Responses

Request samples

Content type
application/json
{
  • "user_ids": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

チャンネルへのユーザー招待

指定チャンネルへユーザーを招待します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

ユーザーを招待するチャンネルID

Request Body schema: application/json
required
user_ids
required
Array of strings non-empty

招待するユーザーIDの配列(最低1件以上必要)

Responses

Request samples

Content type
application/json
{
  • "user_ids": [
    ]
}

Response samples

Content type
application/json
[
  • {
    }
]

チャンネルのアーカイブ解除

指定したチャンネルのアーカイブを解除します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

アーカイブ解除するチャンネルID

Responses

Response samples

Content type
application/json
{
  • "success": true
}

チャンネルに所属するユーザー一覧の取得

指定チャンネルに所属するユーザーを一覧で取得します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

対象となるチャンネルID

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Messages

メッセージの削除

チャンネル内のメッセージを削除します(roleがadminの場合のみ削除可能)。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

メッセージを削除する対象のチャンネルID

Request Body schema: application/json
required
message_ids
required
Array of strings <uuid> (Uuid) non-empty [ items <uuid > ]

Responses

Request samples

Content type
application/json
{
  • "message_ids": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true
}

メッセージ一覧の取得

指定したチャンネル内のメッセージを一覧取得します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

メッセージを取得したいチャンネルのID

query Parameters
limit
integer
Default: 20

取得するメッセージの上限数

anchor_message_id
string <uuid> (Uuid)

取得の基準点となるメッセージID。このIDを含んで後のメッセージを取得します。 指定がない場合は最も古いメッセージから取得します。(reverseがtrueの場合は最も新しいメッセージから取得します)

reverse
boolean
Default: false

true: 新しい順(最新→古い)、false: 古い順(古い→最新) (default: false)

include_reactions
boolean
Default: false

リアクションしたユーザーを含めるかどうかを決定します。 (default: false)

include_read_by
boolean
Default: false

既読したユーザーを含めるかどうかを決定します。 (default: false)

include_reply_messages
boolean
Default: false

返信メッセージを取得するかどうかを決定します。 (default: false) 注意: thread_idが指定されている場合、このパラメータは無視されます。

thread_id
string <uuid> (Uuid)

特定のスレッドの返信のみを取得する場合に親メッセージIDを指定します。 このパラメータを指定した場合、指定した親メッセージへの返信のみが取得されます。

include_thread_reply_info
boolean
Default: false

スレッド返信情報を含めるかどうかを決定します。 (default: false)

Responses

Response samples

Content type
application/json
{
  • "messages": [
    ],
  • "has_more": true,
  • "next_message_id": "string"
}

メッセージの投稿 メッセージの投稿(ファイル付き)

チャンネルに新しいメッセージを投稿します(JSON形式)。 テキストメッセージやURL指定の添付ファイルを送信できます。 チャンネルに新しいメッセージを投稿します(ファイルアップロード)。 バイナリファイルをアップロードできます。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

メッセージを投稿するチャンネルID

Request Body schema:
required
user_id
required
string

メッセージを送信するユーザーのID

object (Messages.CreateMessageRequest)
Array of objects (Messages.AttachmentInput)

Responses

Request samples

Content type
{
  • "user_id": "string",
  • "message": {
    },
  • "attachments": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "content": "string",
  • "channel_id": "string",
  • "thread_id": "1de43264-67cb-48af-89f9-e865c375bb84",
  • "sent_by": {
    },
  • "read_by": [
    ],
  • "reactions": [
    ],
  • "attachments": [
    ],
  • "mentions": [
    ],
  • "thread_reply_info": {
    },
  • "edited_at": "2019-08-24T14:15:22Z",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "metadata": {
    }
}

メッセージを既読にする

指定したユーザーがチャンネル内のメッセージをすべて既読にします。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$
Request Body schema: application/json
required
user_id
required
string [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

メッセージを既読にするユーザーのID

Responses

Request samples

Content type
application/json
{
  • "user_id": "string"
}

Response samples

Content type
application/json
{
  • "success": true
}

メッセージの編集

チャンネル内の既存メッセージを編集します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

メッセージを編集する対象のチャンネルID

message_id
required
string <uuid>

対象のメッセージID

Request Body schema: application/json
required
required
object (Messages.UpdateMessageRequest)

Responses

Request samples

Content type
application/json
{
  • "message": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "content": "string",
  • "channel_id": "string",
  • "thread_id": "1de43264-67cb-48af-89f9-e865c375bb84",
  • "sent_by": {
    },
  • "read_by": [
    ],
  • "reactions": [
    ],
  • "attachments": [
    ],
  • "mentions": [
    ],
  • "thread_reply_info": {
    },
  • "edited_at": "2019-08-24T14:15:22Z",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "metadata": {
    }
}

添付ファイルの削除

メッセージの添付ファイルを削除します。 削除できるのはメッセージの送信者または管理者のみです。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

チャンネルID

message_id
required
string <uuid>

メッセージID

attachment_id
required
string <uuid>

削除するファイルのID

Responses

Response samples

Content type
application/json
{
  • "success": true
}

リアクションの追加

指定したメッセージに対してリアクションを付与します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$
message_id
required
string <uuid>
Request Body schema: application/json
required
user_id
required
string

リアクションを付与するユーザーのID

emoji_code
required
string

リアクションに用いる絵文字のコード

Responses

Request samples

Content type
application/json
{
  • "user_id": "string",
  • "emoji_code": "string"
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "message_id": "d7d9d9fd-478f-40e6-b651-49b7f19878a2",
  • "emoji_code": "string",
  • "user": {
    },
  • "created_at": "2019-08-24T14:15:22Z"
}

リアクションの削除

指定したメッセージに付与されたリアクションを削除します。

Authorizations:
ServerApiKeyAuth
path Parameters
channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$
message_id
required
string <uuid>
reaction_id
required
string <uuid>

Responses

Response samples

Content type
application/json
{
  • "success": true
}

Bots

Botの作成

Botを作成します。

Authorizations:
ServerApiKeyAuth
Request Body schema: application/json
required
bot_user_id
required
string [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

Botの一意な識別子(Bot作成時に任意のidを指定できます) ※ユーザーIDとの重複するIDは指定できません

bot_display_name
required
string [ 1 .. 200 ] characters

Botの表示名

bot_icon_url
string or null

BotのアイコンのURL

object or null

任意の追加メタデータ

Responses

Request samples

Content type
application/json
{
  • "bot_user_id": "string",
  • "bot_display_name": "string",
  • "bot_icon_url": "string",
  • "metadata": {
    }
}

Response samples

Content type
application/json
{
  • "bot_user_id": "string",
  • "bot_display_name": "string",
  • "bot_icon_url": "string",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "metadata": {
    }
}

Botのチャンネル参加

Botをチャンネルに参加させます。

Authorizations:
ServerApiKeyAuth
path Parameters
bot_user_id
required
string (UserId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

Botの一意なID

Request Body schema: application/json
required
channel_ids
required
Array of strings (ChannelId) non-empty [ items [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$ ]

参加させるチャンネルIDの配列(最低1件以上必要)

Responses

Request samples

Content type
application/json
{
  • "channel_ids": [
    ]
}

Response samples

Content type
application/json
[
  • "497f6eca-6276-4993-bfeb-53cbbbba6f08"
]

Botメッセージの送信

Botからメッセージを送信します

Authorizations:
ServerApiKeyAuth
path Parameters
bot_user_id
required
string (UserId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

Botの一意なID

channel_id
required
string (ChannelId) [ 1 .. 100 ] characters ^[a-zA-Z0-9_-]+$

メッセージを投稿するチャンネルID

Request Body schema: application/json
required
content
required
string <= 32000 characters

メッセージ本文

thread_id
string or null <uuid>

スレッドメッセージとして返信する場合の親メッセージID

object or null

任意の追加メタデータ

Array of objects (Messages.MentionInput)

メンション一覧(送信時)

Responses

Request samples

Content type
application/json
{
  • "content": "string",
  • "thread_id": "1de43264-67cb-48af-89f9-e865c375bb84",
  • "metadata": {
    },
  • "mentions": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "content": "string",
  • "channel_id": "string",
  • "thread_id": "1de43264-67cb-48af-89f9-e865c375bb84",
  • "sent_by": {
    },
  • "read_by": [
    ],
  • "reactions": [
    ],
  • "mentions": [
    ],
  • "edited_at": "2019-08-24T14:15:22Z",
  • "created_at": "2019-08-24T14:15:22Z",
  • "updated_at": "2019-08-24T14:15:22Z",
  • "deleted_at": "2019-08-24T14:15:22Z",
  • "metadata": {
    }
}