How we created “Open Lines” in “Bitrix24”

    Today, users want to communicate with companies not by e-mail and telephone, but through their favorite instant messengers and accounts in social networks.

    In response, social networks and instant messengers began to introduce new features. VKontakte and Facebook rolled out personal messages for groups and public pages.

    Telegram with its channels and bots has become a platform for publishing and interacting with the audience. In Viber appeared public accounts.

    To get the maximum profit, businesses need to use all the features of all social platforms.

    This is how “Open Lines” was born - a new tool for interaction between Bitrix24 customers and end users.



    The work scheme of the "Open Lines" is simple:

    1. We receive all user messages from instant messengers and social networks.
    2. Routing them with the built-in messenger in Bitrix24. Distributed by operators
    3. Clients respond to messages, and we route the answers back to the managers of companies working on Bitrix24.

    The main task of development in this project is to simplify the connection of communication channels. So that any average manager could do it. For this, we had to negotiate with the developers of all the integrated social networks and instant messengers - everything is official, no tweaks.

    And in order to ensure stable operation in the cloud and boxed versions of Bitrix24, we created a centralized server of connectors. It processes all streams of information.

    In contact with


    The next step was a close duet with VKontakte developers. We managed to build an optimal scheme of work with the service - now we did a bunch of technical actions for users to connect.

    Now other services can use this API VKontakte.

    Now the “Open lines” connection for a regular user looks like:

    • Sign in to VK.
    • In the connection section, select the desired group.
    • Confirm.







    It looks simple, but only because we hid the whole “kitchen” under the hood - about ten operations, along with requests for obtaining different keys.

    Skype


    But with Microsoft it was difficult. Unfortunately, they are very focused on "old school" IT people. Connecting to their bot framework has been complicated. Now for this you need to pass the horror quest:

    • Install the application.
    • Create an account.
    • In Skype take one key.
    • In "Bitrix 24" - the other.
    • To plug.

    Viber


    We did this integration one of the first. Constantly communicated with the developers of the messenger. In general, they kept their hands on the pulse. Now “Open Lines” can be connected from “Bitrix24” or from the Viber mobile application.

    Telegram


    Telegram has a simple API - the connection is simple. And despite all the blocking, now everything works.

    Instagram


    Instagram integration is one of the most popular with our customers. But because of the scandal over the dissemination of personal data, Instagram severely curtailed API capabilities.

    We have to self-poll it once every 15 minutes and identify new messages. Moreover, the API allows you to receive not the messages themselves, but only comments to posts. There is also a limit on the number of responses per hour.

    External systems are living organisms in which something is constantly changing. The API of social networks and messengers makes some changes, often there are some errors from the "other" side.

    Example. On VKontakte, the encoding in the names of the goods broke, they solved this problem within a year. Instagram simply did not warn anyone about disabling a number of API functions - we learned after the fact that some features had stopped working. We had to look for solutions in emergency mode.

    After the successful integration of the social network or messenger can not relax. We constantly have to monitor the correctness of processing incoming messages.

    Connector server


    The open lines architecture is based on a connector server. This is a single entry point in the messaging scheme between the internal messenger "Bitrix24" and external messengers and social networks.

    In "Open lines" there are three types of incoming channels:

    • External that work through the server queues.
    • Online chat, which works on the client portal. We take the widget code from the client's portal. And there is no talk about non-delivery of messages in this case - if the portal is “lying”, the chat widget simply will not be displayed.
    • Network - a channel that allows you to create an "open line" and find among other portals "Bitrix24", including the box. This is especially true for our partners who want to organize support chats for their client companies. These chats work through the Bitrix24 bot-platform and do not use the server of connectors - all operations take place inside our platform.

    In all the "open lines" and connectors connect, there is an important nuance. It is assumed that the first client always takes the initiative. We can only reply to user messages. But do not write them first.

    The server is in the cloud and is available 24/7. It receives messages from users without holidays and weekends. The portal may be temporarily unavailable for a client with a boxed version of Bitrix24: a server has been dropped or Internet problems have occurred. In such cases, messages from users could be lost.

    This problem is solved by the cloud server connectors.

    First, it routes the messages directly to the destination portals. If a portal is unavailable, the connector server accumulates messages for that portal within 24 hours. And trying to deliver them to the portal.

    We found - 24 hours is enough to fix any problems and restart the boxed portal. We made a strong emphasis on the fact that the order of messages will not change. All content will be delivered exactly in the order in which it was written. Custom messages, albeit with a delay, but will be delivered.

    All external systems have their own message formats, with their own data sets. Somewhere you can share emoji, pictures and other files. And somewhere only text is available with a very limited set of possibilities.

    Connector Server:

    • Lists all incoming messages in a universal format that portals understand.
    • Encrypts data and signs it with a license key.
    • Transmits them to the portals.

    Encryption is needed not only to protect the correspondence itself, but also to confirm the authenticity of the parties.

    After unifying the format of the message are in the queue. From it, they fly to the recipients.

    Social networks can generate messages with an impressive frequency, but not all client portals can boast of powerful hardware. Other tasks can run in parallel on the same machine.

    And if the messages will go "shaft" - there is a possibility of duplication of sessions. To prevent this from happening, messages are transmitted to each portal in one stream, in batches and with a slight delay.

    Now the queue is on the connector server, but we have a separate scalable server ready. It supports different types of queues:

    1. Parallel in several streams.
    2. Consistent in one thread.

    Delivery may be:

    1. Guaranteed. Many attempts.
    2. Not guaranteed. One try.

    Soon we will transfer to this server connectors of social networks, bot platforms and instant messengers. Hooray!

    Configuring and processing messages


    We have tried to make the connection and configuration of "Open lines" as easy as possible.

    "Bitrix24" is used by a variety of companies, from large representatives of the IT-business to individual entrepreneurs selling auto parts. Even an IT admin is easier to make a few clicks. Instead of studying the documentation, register keys and configs.

    In "Open lines" there are a number of settings for the operator queue, working time, working with CRM, various chat trackers and forms.

    The system takes into account whether a particular operator’s work day has begun, whether it is online or offline, and a number of other parameters.

    To process messages, operators use either the Bitrix24 application or the built-in instant messenger. There are additional management tools: accept, skip, reject, complete.

    After completion of the correspondence with the user, the system can automatically ask him to rate.

    Also popular now: