Open Channel Messages: Overview of Methods

Messages in open channel chats can be sent by employees and chatbots. Sent messages can be saved as quick reply templates and reused. Each open channel chat is linked to a CRM entity.

Quick navigation: all methods

Linking Messages to Other Entities

CRM. A chat message is tied to one of four CRM entities: lead, deal, contact, or company.

User. An employee sends a message in the open channel chat. The employee's ID can be obtained using the user.get and user.search methods.

Chatbot. A message can be sent on behalf of a chatbot. Work with bots should be done using the imbot.* methods.

Dialogs. The chat history can be retrieved using the chat ID CHAT_ID with the imopenlines.session.history.get method.

Open Channels. To add, modify, and delete channels, use the imopenlines.* methods.

Universal Lists. The ID of the quick replies list QUICK_ANSWERS_IBLOCK_ID can be obtained using the imopenlines.config.get method. Specify the list when creating a channel using the imopenlines.config.add method, and when editing, use the imopenlines.config.update method.

How to Send a Message from CRM

  1. Find the chat linked to the CRM entity. Use the imopenlines.crm.chat.get or imopenlines.dialog.get method.
  2. Obtain the ID of the employee or chatbot using the user.get, user.search, or imbot.bot.list methods.
  3. Pass the data to the imopenlines.crm.message.add method to send the message.

How to Save a Quick Reply

  1. Retrieve the chat history using the imopenlines.session.history.get method and select the message to save.
  2. Pass the IDs CHAT_ID and MESSAGE_ID to the imopenlines.message.quick.save method. The message will be saved in the quick replies list.

Overview of Methods

Scope: imopenlines

Who can perform the methods: depending on the method

Method

Description

imopenlines.crm.message.add

Sends a message in the chat linked to the CRM entity

imopenlines.message.quick.save

Saves a message as a quick reply