Development of a Viber Bot with Bitrix24 Integration

Our company is engaged in the development, support and maintenance of Bitrix and Bitrix24 solutions of any complexity. From simple one-page sites to complex online stores, CRM systems with 1C and telephony integration. The experience of developers is confirmed by certificates from the vendor.
Showing 1 of 1All 1626 services
Development of a Viber Bot with Bitrix24 Integration
Medium
~1-2 weeks
Frequently Asked Questions

Our competencies:

Development stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1357
  • image_bitrix-bitrix-24-1c_fixper_448_0.webp
    Website development for FIXPER company
    943
  • image_bitrix-bitrix-24-1c_development_of_an_online_appointment_booking_widget_for_a_medical_center_594_0.webp
    Development based on Bitrix, Bitrix24, 1C for the company Development of an Online Appointment Booking Widget for a Medical Center
    693
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    829
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    731
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    1073

Manual processing of requests from Viber overloads managers. Customers wait for a response, leads are lost. For businesses with an audience on Viber — such as food delivery or a service center — automation via a chatbot becomes a necessity. We create Viber bots that integrate with Bitrix24 and guarantee that 70–80% of typical queries are handled without human intervention. Unlike WhatsApp, Viber provides an open Viber Bot API without complex approvals — anyone can create a public account. But there is a catch: Viber does not transmit the phone number. There is a workaround, which we explain below. Our specialists are certified in 1C-Bitrix and have over 5 years of experience in integration development. Customer response speed is reduced by 5 times compared to manual processing.

What is the Viber Bot API?

The Viber Bot API is accessible via https://chatapi.viber.com/pa/. To register a bot, create a Bot/Public Account in the Viber app, after which you receive an auth_token. The API supports:

  • Text messages, images, documents, videos, stickers.
  • Rich Messages — messages with buttons (Keyboard API).
  • Carousel — horizontal list of cards with buttons (Rich Media).
  • Retrieving user profile: name, avatar, country (no phone number).
  • Webhook for incoming messages.

The main limitation: Viber does not transmit the user's phone number to the bot. The identifier is viber_id (a unique hash for each bot-user pair). To link to CRM, you must ask the user to enter their phone manually or use the "Share Contact" button (works unreliably).

Architecture of Viber-Bitrix24 Integration

Viber Bot API (webhook)
      ↓
Server bot (Python / Node.js)
      ↓ ↓
  Logic     Bitrix24 REST API
  + Redis    crm.contact.list
  (states)   crm.lead.add
             imbot.message.add

Incoming webhook from Viber:

{
  "event": "message",
  "sender": {
    "id": "01234567890A=",
    "name": "Ivan Ivanov",
    "country": "BY"
  },
  "message": {
    "type": "text",
    "text": "Order status"
  }
}

Response via Viber API with buttons:

POST https://chatapi.viber.com/pa/send_message
{
  "receiver": "01234567890A=",
  "type": "text",
  "text": "Enter order number:",
  "keyboard": {
    "Type": "keyboard",
    "Buttons": [
      {"ActionType": "reply", "ActionBody": "operator", "Text": "Contact operator"}
    ]
  }
}

How to Identify a Customer Without a Phone?

The absence of a phone in the Viber profile requires a separate verification scenario:

  1. The bot greets the user, suggests entering a phone number.
  2. The user enters the number in format +375....
  3. The bot sends an SMS confirmation code via an SMS provider.
  4. The user enters the code → the bot links viber_id to the CRM contact in the field UF_CRM_VIBER_ID.
  5. On subsequent interactions — identification by viber_id without re-entering the phone.

An alternative for corporate scenarios: the "Share Contact" button in Viber (type share-phone). It doesn't work on all client versions, but when it does, it transmits the phone automatically.

Integration with Bitrix24 Open Lines

Viber connects to Open Lines natively: CRM → Contact Center → Viber. This is a simple route without development — messages from Viber go to the operator queue.

For more complex scenarios (bot + operator), a hybrid scheme is used:

  • A custom server bot processes automatable requests.
  • When transferring to an operator, the bot sends a message to the Open Line via imopenlines.chat.sendMessage or creates a chat via im.chat.add and adds history.

Case Study from Our Practice: Viber Bot for Food Delivery

Task: a network of cafes in Minsk, main audience on Viber. Needed order placement for delivery without a call, confirmation via chatbot.

Order scenario via Carousel:

  1. Customer writes "Order" → bot shows menu categories with buttons.
  2. Selection of dishes via Rich Media Carousel (cards with photo, price, "+" button).
  3. Cart stored in Redis by viber_id.
  4. Enter delivery address → delivery zone check.
  5. Payment: "Pay Online" button → link to payment page.
  6. After payment: create a deal in Bitrix24 crm.deal.add with status "Accepted", responsible person is the outlet manager.
  7. Confirmation and order tracking via notifications in Viber (send_message when deal stage changes).

Peculiarity: Rich Media Carousel in Viber is limited to 6 cards at a time. For a large menu — pagination with "More" buttons.

Result: 40% of orders shifted from phone calls to the Viber bot in the first two months. Average order value through the bot turned out to be 12% higher — customers choose and add items more calmly. Compared to a mobile app, development cost is 3–5 times lower, and the bot answers 5 times faster than a human operator. Contact us — we will select the optimal solution for your business.

Estimated Effort for Typical Components

Component Effort
Basic bot + Viber webhook 8-16 h
Phone verification + CRM linking 8-16 h
Rich Media Carousel for catalog 16-24 h
Bitrix24 CRM integration 8-16 h
Cart in Redis + order logic 8-16 h
Deployment, SSL, monitoring 4-8 h

What's Included in the Work

Stage Work Scope
Analysis Study of business processes, requirements gathering, scenario prototyping
Bot development Viber Bot API setup, server logic in Python/Node.js, Rich Media, cart
Bitrix24 integration REST API: deals, contacts, leads, Open Lines, webhooks
Customer verification SMS confirmation, linking viber_id to CRM
Deployment and monitoring Server hosting, SSL, health checks, alerts
Documentation and training Manuals for operators and administrators, bot workflow diagram, access handover
Warranty support 1 month warranty, bug fixes, consultations

Comparison with alternatives: a Viber bot requires 3-5 times less budget than developing a mobile app, and pays off in 2-3 months with 50+ orders per day. Get a consultation — we will assess your project for free.

Process and Timeline

  1. Analytics — 1-2 days: description of scenarios, prototype approval.
  2. Design — 2-3 days: architecture, stack selection, database design.
  3. Development — from 5 to 15 days depending on complexity.
  4. Integration testing — 2-3 days: verification of all chains, load testing.
  5. Deployment and launch — 1-2 days: server setup, domain, SSL, monitoring.
  6. Team training — 1 day: operator briefing, documentation handover.

Estimated timeline — from 2 to 4 weeks. We provide an accurate estimate after requirements analysis. Contact us — we will discuss your project and prepare a commercial proposal.

Technical Implementation Details To ensure security, webhooks must be protected with an SSL certificate. It is recommended to verify Viber signature using `X-Viber-Content-Signature`. The Redis database is used to store dialog states and cart, avoiding data loss on server restart.

Open Lines: Where It All Begins and Breaks

The Open Lines module (imopenlines) is the standard Bitrix24 mechanism for omnichannel communications. It connects an external channel to an internal chat via the Im\Model\ChatTable entity. The problem is that out-of-the-box routing settings are primitive: "in turn" or "all at once." For a real sales department with 15+ managers, VIP clients, and SLA response times, this is not enough. We enhance routing via event handlers OnImOpenLinesChatStart and the REST API.

A manager switching between five windows loses messages, forgets to reply—the client leaves for a competitor who responded in 30 seconds. Bitrix24 messenger configuration gathers all channels into one interface, and CRM records every touch. Experience shows that after setup, average first response time drops by 40% within the first week.

How we implement messenger integration

We connect Telegram, WhatsApp, Viber, VK, online chat, email, and other channels via standard connectors or REST API. Each channel requires its own configuration, but the result is unified—all messages end up in open lines, and from there into the client card. We guarantee no message gets lost: we use tagged caching and agents to check queues.

How to connect WhatsApp to Bitrix24?

WhatsApp is the main business channel. Integration via WhatsApp Business API with a verified account. We configure sending and receiving messages from the Bitrix24 interface—they fall into an open line. We create HSM templates for initiating dialog (abandoned cart reminders, order status). Templates go through Meta moderation—allow 2-3 days. We ensure file, image, and document transfer. We link conversations to contacts and deals via CRM_ENTITY_TYPE and CRM_ENTITY_ID.

Method Nuances Payment Model
WhatsApp Business API (Cloud) Verification via Meta Business, templates, bulk messaging Per conversation window (24h)
Provider (Edna, Wazzup, Chat2Desk) Quick start, intermediary service, own limits Subscription fee
Bitrix24 CRM Marketing Built-in integration, minimal setup Included in Professional+ tariff

Telegram: Free Channel with High Reach

Telegram Bot API is free and well-documented—a pleasant rarity among messengers. Integration into Bitrix24 is done via the imopenlines connector. Setup: connect the bot to open lines, configure the connector to Telegram. Receiving messages, photos, videos, documents—all mapped to the Bitrix24 chat. Inline buttons and reply keyboards for navigation. Webhook on https://yourdomain/rest/imconnector.register—register the connector. CRM integration: incoming message creates a lead via crm.lead.add or an activity in the deal.

Telegram is indispensable for:

  • Support via bot—standard questions resolved without an operator (up to 70% of inquiries).
  • Notifications: orders, delivery, payment—via Telegram Bot API sendMessage.
  • Lead collection: bot asks qualifying questions → creates a lead.

Viber and VK: Audience 35+ and Social Network

Viber maintains positions in regions. We connect a business account via the open lines connector. We use Viber Business Messages—bulk messaging with action buttons and rich content. Receiving and sending from CRM works immediately.

VK (Vkontakte) is the largest social network in Russia. Integration via the imopenlines community messages connector. Process messages and comments from a single interface. Auto-creation of a lead—handler OnImOpenLinesCrmCreate. Integration with VK Ads for tracking sources via UTM. Bot for auto-replies—VK Bot API + Callback API.

Why is proper routing of inquiries important?

Distribution of inquiries among operators is organized through queue mechanisms. By default: "who is free." In reality, more complexity is needed:

  • Determining responsible person by number or email from CRM—im.chat.get + search via crm.contact.list.
  • Distribution by departments based on keywords (NLP classifier or simple regex on first message).
  • Priority queue for VIP—by segment in CRM.
  • Escalation on 5-minute timeout—auto-switch to next.
  • Transition to call directly from chat—telephony.externalcall.register.

We use custom event handlers OnImOpenLinesChatStart and REST API to implement such scenarios. Additionally, we connect Bizproc for complex approval chains and integration with HL blocks for storing custom queue parameters. Result: client does not wait, operator is not overloaded.

What is included in messenger integration work

Component Description
Audit of current CRM structure Analysis of inquiry types, channels, operator load
Connecting channels Configuration of WhatsApp, Telegram, Viber, VK, email, online chat connectors
Routing setup Queues, distribution by competence, escalations, SLA
Chatbot development Script-based or with NLP, integration with CRM and external APIs
Operator training Documentation, video instruction recording, webinar
Testing and support Running all scenarios, 2-week monitoring after launch
6-month warranty Free bug fixes, consultations

Chatbots: Script-Based and with NLP

Types

Script-based (rule-based): button menu, decision tree. "How to pay" → "Where is my order" → "Business hours." Transfer to operator at intent == 'unknown' → transfer_to_queue. Reliable, predictable, covers 60-70% of typical inquiries.

With NLP: free text in Russian. Intent detection (buy, complain, inquire about delivery), entity extraction (name, date, order number). Contextual dialog—remembers what was discussed. Implemented on Rasa or Dialogflow, integrated with Bitrix24 via REST.

Example handler code for a script-based bot (PHP)
use Bitrix\Main\Loader;
use Bitrix\Imopenlines\Model\SessionTable;

Loader::includeModule('imopenlines');

$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->addEventHandler('imopenlines', 'OnImOpenLinesMessageReceive', function($event) {
    $message = $event->getParameter('message');
    $chatId = $event->getParameter('chatId');
    
    if (preg_match('/order status (\d+)/i', $message, $matches)) {
        $orderId = $matches[1];
        // Get order status via API
        $order = \Bitrix\Sale\Order::load($orderId);
        if ($order) {
            $status = $order->getField('STATUS_ID');
            \Bitrix\ImOpenLines\Chat::sendMessage($chatId, 'Your order #' . $orderId . ' status: ' . $status);
        }
    }
});

Scenarios and Real Impact

Scenario Action Operator Relief
FAQ Answers from knowledge base based on intent match 30-50%
Order status Request sale.order.get by number 15-25%
Booking Date/specialist selection, creation via API 20-30%
Calculation Preliminary estimate based on parameters 10-20%
Lead qualification Data collection → crm.lead.add 3x funnel acceleration
NPS/CSAT Rating after service 100% automatic collection

Comparison: a script-based bot processes requests 5 times faster than an operator, and an NLP bot reduces fallback rate to 15% after training on real dialogs. Average savings on operator salary when implementing a chatbot amount to substantial monthly savings.

How can chatbots transform your customer support?

Development Process

  1. Inquiry analysis—export history from open lines, cluster by topic. Identify 80% of typical requests.
  2. Dialog design—map on miro/figma. Each branch ends either with an answer or transfer to operator.
  3. Development—logic, integration with CRM and external APIs. For script-based: finite state machine. For NLP: pipeline: tokenizer → featurizer → classifier → response selector.
  4. NLP training—on real dialogs (at least 500 examples). Set confidence threshold.
  5. Testing—run all branches, edge cases (empty message, sticker, voice).
  6. Optimization—monitor fallback rate, retrain on new dialogs every 2 weeks.

Timeline

Task Duration
Single messenger connection 1-2 days
Open lines setup 2-3 days
Script-based bot (basic) 1-2 weeks
Bot with NLP 3-6 weeks
Comprehensive omnichannel system 4-8 weeks

Result: all communications in one window, routine automated, no message lost. Managers sell, not search for the right chat. Evaluate which channels you need—contact us, we'll select for your niche. Get a personalized timeline and cost estimate for your project.