Skip to main content
Version: 8.1

Chat management API

Level: intermediate

The preinstalled OmnichannelMessaging package contains the basic chat management functionality.

Learn more about setting up messenger integration in the user documentation guide: Chat setup.

Integrate a messenger

The following libraries contain the core of the messenger integration functionality:

  • OmnichannelMessaging.dll
  • OmnichannelProviders.dll

The MessageManager class enables the messenger integration.

The primary methods of the MessageManager class are as follows:

  • Receive. Receives incoming messages in the unified format (UnifiedMessage, a unified message class) or as a string, which is then converted into the unified format. If the conversion is required, the method uses a class that implements the IIncomeMessageWorker interface. The interface is implemented differently for each messenger. The method also saves messages in Creatio.
  • Send. Sends outgoing messages. Creatio selects the relevant message sender class. The class must implement the IOutcomeMessageWorker interface. The method also saves messages in Creatio.
  • Register. Adds a channel when setting up Facebook Messenger integration. The method uses the class that implements the IMessengerRegistrationWorker interface. Required for messengers that need additional actions upon registration. For example, retrieve a token.
  • GetMessagesByChatId. Retrieves messages of a specific chat in the IEnumerable<UnifiedMessage> format. Pass the chat in method parameters

Receive messages

The messenger specific message reception services are as follows:

  • FacebookOmnichannelMessagingService. Receives Facebook Messenger messages.
  • TelegramOmnichannelMessagingService. Receives Telegram messages.

Both services are based on the OmnichannelMessagingService service that contains the set methods that are common for both messengers.

InternalReceive is the primary method of the OmnichannelMessagingService service. Receives messages.

Manage chats in Creatio

Creatio includes the following chat management services:

  • OmnichannelChatService. Lets you retrieve history, chats of a specific agent, etc.
  • OmnichannelOperatorService. Lets you retrieve and change the agent status.

The primary methods of the OmnichannelChatService service are as follows:

  • AcceptChat. Assigns the chat to the current user.
  • GetUnreadChatsCount. Retrieves the number of unread chats.
  • MarkChatAsRead. Marks all messages in the chat as read.
  • GetConversation. Retrieves chat messages to display them in the communication panel.
  • CloseActiveChat. Closes the chat.
  • GetChats. Retrieves all chats of the agent.
  • GetChatActions. Retrieves the list of actions available for the chat’s queue.
  • GetUnreadMessagesCount. Retrieves the number of unread messages in all chats of the agent.

Add a new channel provider

  1. Add a new provider to the Channel provider lookup.
  2. Implement the database storage of the new channel’s data.
  3. Register the new channel in the database.
  4. Create a web service that receives messages.
  5. Implement the conversion of incoming messages to the unified Creatio format.
  6. Implement retrieval of data in a class that implements the IProfileDataProvider interface.
  7. Implement the download of attachments.
  8. Implement the sending of messages in a class that implements the IOutcomeMessageWorker interface.
  9. Link the interfaces.

Resources

Chat setup Creatio documentation