Retail CRM Bot API (1.0.0)

Download OpenAPI specification:Download

WebSocket API для получения событий от платформы Retail CRM Bot.

Connection

Получение событий от платформы Retail CRM Bot

Подключение для получения различных типов событий в режиме реального времени

query Parameters
events
string
Example: events=message_new,dialog_opened,user_joined_chat

Список событий через запятую, на которые нужно подписаться

options
string

Список дополнительных опций для подключения через запятую

header Parameters
Authorization
required
string

Токен авторизации для WebSocket подключения

Responses

Events

Событие нового сообщения Webhook

Request Body schema: application/json
required
type
required
string
Value: "message_new"
required
object (MessageData)

Данные сообщения

Request samples

Content type
application/json
{
  • "type": "message_new",
  • "data": {
    • "message": {
      }
    }
}

Событие обновления сообщения Webhook

Request Body schema: application/json
required
type
required
string
Value: "message_updated"
required
object (MessageData)

Данные сообщения

Request samples

Content type
application/json
{
  • "type": "message_updated",
  • "data": {
    • "message": {
      }
    }
}

Событие обновления файла Webhook

Request Body schema: application/json
required
type
required
string
Value: "file_updated"
required
object (FileUpdatedData)

Данные обновленного файла

Request samples

Content type
application/json
{
  • "type": "file_updated",
  • "data": {
    • "file": {
      }
    }
}

Событие удаления сообщения Webhook

Request Body schema: application/json
required
type
required
string
Value: "message_deleted"
required
object (MessageData)

Данные сообщения

Request samples

Content type
application/json
{
  • "type": "message_deleted",
  • "data": {
    • "message": {
      }
    }
}

Событие восстановления сообщения Webhook

Request Body schema: application/json
required
type
required
string
Value: "message_restored"
required
object (MessageData)

Данные сообщения

Request samples

Content type
application/json
{
  • "type": "message_restored",
  • "data": {
    • "message": {
      }
    }
}

Событие создания чата Webhook

Request Body schema: application/json
required
type
required
string
Value: "chat_created"
required
object (ChatData)

Данные чата

Request samples

Content type
application/json
{
  • "type": "chat_created",
  • "data": {
    • "chat": {
      }
    }
}

Событие обновления чата Webhook

Request Body schema: application/json
required
type
required
string
Value: "chat_updated"
required
object (ChatData)

Данные чата

Request samples

Content type
application/json
{
  • "type": "chat_updated",
  • "data": {
    • "chat": {
      }
    }
}

Событие удаления чата Webhook

Request Body schema: application/json
required
type
required
string
Value: "chats_deleted"
required
object (ChatsDeletedData)

Данные о удаленных чатах

Request samples

Content type
application/json
{
  • "type": "chats_deleted",
  • "data": {
    • "chat_ids": [
      ]
    }
}

Событие открытия диалога Webhook

Request Body schema: application/json
required
type
required
string
Value: "dialog_opened"
required
object (DialogData)

Данные диалога

Request samples

Content type
application/json
{
  • "type": "dialog_opened",
  • "data": {
    • "dialog": {
      }
    }
}

Событие назначения диалога Webhook

Request Body schema: application/json
required
type
required
string
Value: "dialog_assign"
required
object (DialogAssignData)

Данные о назначении диалога

Request samples

Content type
application/json
{
  • "type": "dialog_assign",
  • "data": {
    • "dialog": {
      },
    • "chat": {
      }
    }
}

Событие закрытия диалога Webhook

Request Body schema: application/json
required
type
required
string
Value: "dialog_closed"
required
object (DialogData)

Данные диалога

Request samples

Content type
application/json
{
  • "type": "dialog_closed",
  • "data": {
    • "dialog": {
      }
    }
}

Событие обновления статуса пользователя (онлайн/оффлайн) Webhook

Request Body schema: application/json
required
type
required
string
Value: "user_online_updated"
required
object (UserOnlineUpdatedData)

Данные о обновлении статуса пользователя

Request samples

Content type
application/json
{
  • "type": "user_online_updated",
  • "data": {
    • "user": {
      },
    • "online": true,
    • "connected": true
    }
}

Событие присоединения пользователя к чату Webhook

Request Body schema: application/json
required
type
required
string
Value: "user_joined_chat"
required
object (UserJoinedChatData)

Данные о присоединении пользователя к чату

Request samples

Content type
application/json
{
  • "type": "user_joined_chat",
  • "data": {
    • "chat": {
      },
    • "user": {
      }
    }
}

Событие выхода пользователя из чата Webhook

Request Body schema: application/json
required
type
required
string
Value: "user_left_chat"
required
object (UserLeftChatData)

Данные о выходе пользователя из чата

Request samples

Content type
application/json
{
  • "type": "user_left_chat",
  • "data": {
    • "reason": "string",
    • "chat": {
      },
    • "user": {
      }
    }
}

Событие обновления данных пользователя Webhook

Request Body schema: application/json
required
type
required
string
Value: "user_updated"
required
object (UserUpdatedData)

Данные о обновлении информации о пользователе

Request samples

Content type
application/json
{
  • "type": "user_updated",
  • "data": {
    • "id": 0,
    • "external_id": "string",
    • "type": "user",
    • "name": "string",
    • "avatar": "http://example.com",
    • "first_name": "string",
    • "last_name": "string",
    • "available": true,
    • "is_blocked": true,
    • "is_system": true,
    • "is_technical_account": true,
    • "username": "string",
    • "email": "user@example.com",
    • "phone": "string",
    • "is_active": true
    }
}

Событие обновления данных клиента Webhook

Request Body schema: application/json
required
type
required
string
Value: "customer_updated"
required
object (CustomerUpdatedData)

Данные о обновлении информации о клиенте

Request samples

Content type
application/json
{
  • "type": "customer_updated",
  • "data": {
    • "id": 0,
    • "external_id": "string",
    • "type": "user",
    • "name": "string",
    • "avatar": "http://example.com",
    • "first_name": "string",
    • "last_name": "string",
    • "available": true,
    • "is_blocked": true,
    • "is_system": true,
    • "is_technical_account": true,
    • "username": "string",
    • "email": "user@example.com",
    • "phone": "string"
    }
}

Событие обновления данных бота Webhook

Request Body schema: application/json
required
type
required
string
Value: "bot_updated"
required
object (BotUpdatedData)

Данные о обновлении информации о боте

Request samples

Content type
application/json
{
  • "type": "bot_updated",
  • "data": {
    • "id": 0,
    • "external_id": "string",
    • "type": "user",
    • "name": "string",
    • "avatar": "http://example.com",
    • "first_name": "string",
    • "last_name": "string",
    • "available": true,
    • "is_blocked": true,
    • "is_system": true,
    • "is_technical_account": true,
    • "username": "string",
    • "email": "user@example.com",
    • "phone": "string"
    }
}

Событие обновления данных канала Webhook

Request Body schema: application/json
required
type
required
string
Value: "channel_updated"
required
object (ChannelUpdatedData)

Данные о обновлении канала

Request samples

Content type
application/json
{
  • "type": "channel_updated",
  • "data": {
    • "channel": {
      }
    }
}