Open Channel Chats and CRM: Overview of Methods

Open channel chats are a space within Bitrix24 for communicating with clients through external systems: online chat on the site, messengers, and social networks. They allow linking dialogues to CRM cards, adding users or chatbots to the dialogues.

Quick navigation: all methods

User documentation: How to work with chats in Open Channels

Linking Chats with Other Objects

CRM. Each chat is linked to one of four CRM objects: leads, deals, contacts, or companies.

User. A user can be added to the chat. The user ID can be obtained using the methods user.get and user.search.

Chatbot. A bot can be added to the chat. Work with bots should be done using the methods imopenlines.bot.*.

To add a bot to an open channel chat, it must have the scope crm.

Dialogues. The chat history can be retrieved by the chat ID CHAT_ID using the method imopenlines.session.history.get.

Open Channels. Adding, modifying, and deleting open channels is facilitated by the methods imopenlines.*.

Connector. Chats are created through a connector. The communication channel can be an online chat, messenger, or social network. To connect the connector or change settings, use the group of methods imconnector.*.

How to Work with Chats

  1. Use imopenlines.crm.chat.get to get a list of chats linked to the CRM object.

  2. Find the last active chat using imopenlines.crm.chat.getLastId.

  3. Add or remove chat participants using the methods imopenlines.crm.chat.user.add and imopenlines.crm.chat.user.delete.

  4. To send a message, use the method imopenlines.crm.message.add.

  5. In imopenlines.crm.lead.create, pass the chat ID CHAT_ID and create a lead based on the dialogue.

Overview of Methods

Scope: imopenlines

Who can execute the method: any user

Method

Description

imopenlines.crm.chat.getLastId

Retrieves the ID of the last chat for the CRM entity

imopenlines.crm.chat.get

Retrieves chats for the CRM entity

imopenlines.crm.chat.user.add

Adds a user to an existing chat of the CRM entity

imopenlines.crm.chat.user.delete

Removes a user from the chat of the CRM entity