Developers now can integrate into Bitrix24 Messenger, by adding an icon to text input panel:
If the app is not loading the image, service Application for chat icon will appear. After clicking on it, a text variant of the icon will appear.
There are two types of chat application:
JS command - when clicking on the icon, a chatbot command will be inserted into input field, a command will be sent to chat, telephone call will be initiated, or a support open channel will be opened.
With the help of this format, developers can integrate a button in their chatbots to contact them.
Example of such command for Martha chatbot - an icon for tick-tack-toe game:
IFRAME application - it is an improved format. When clicking the button, IFRAME application will open, where the developer can do anything he/she desires.
Application can cooperate with chat via JS-commands:
to insert message into input field
to send message on behalf of user
to close dialogue
to open technical support chat (OC consultant)
to make call
Example of such implementation can be found in the example of Giphy chatbot:
Tell the difference - previously you we're typing command in the form of a message and GIPHY returned you a random picture on the topic. Now you can see, what you are sending out.
Attention: icons can understand context, and it means that the app can be displayed only in those chats that you require.
For example, to communicate with technical support, it is better to deploy the app in your chatbot context. In other chats it will be excessive. Or you can develop a special application for Open Channels - it should be displayed only in the context of Open Channels.
Accessible contexts: all, chat, bot, lines, user, call.
Postfix can be added to each context -admin - then the icon will be displayed in the required context only to administrators.
Context Applications are created to help user to interface with chatbot within the specific dialogue (message).
For example, client writes in an open channel, open channel chatbot analyzes the message and prepares the variants of responses. To not disturb the work of operators and not to show the full flow of data to it, we are neatly creating a button, upon clicking on which, the IFRAME application will be initialized.