Chat management API
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 theIIncomeMessageWorker
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 theIOutcomeMessageWorker
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 theIMessengerRegistrationWorker
interface. Required for messengers that need additional actions upon registration. For example, retrieve a token.GetMessagesByChatId
. Retrieves messages of a specific chat in theIEnumerable<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
- Add a new provider to the Channel provider lookup.
- Implement the database storage of the new channel’s data.
- Register the new channel in the database.
- Create a web service that receives messages.
- Implement the conversion of incoming messages to the unified Creatio format.
- Implement retrieval of data in a class that implements the
IProfileDataProvider
interface. - Implement the download of attachments.
- Implement the sending of messages in a class that implements the
IOutcomeMessageWorker
interface. - Link the interfaces.