Viber Bot Development with Bitrix24 Integration
Viber remains a popular channel in Belarus, Ukraine, and several other CIS countries. Unlike WhatsApp, Viber provides an open Bot API for free and without complex approvals — anyone can create a public account and connect a bot. This simplifies development, but the audience is smaller, and this should be considered when choosing communication channels.
Viber Bot API: What Is Available
Viber provides the Viber Bot API via https://chatapi.viber.com/pa/. Bot registration is done by creating a Bot/Public Account in the Viber app. After creation, an auth_token is issued.
Capabilities available in the Viber Bot API:
- Text messages, images, documents, videos, stickers.
- Rich Messages — messages with buttons (Keyboard API).
- Carousel — a horizontal list of cards with buttons (Rich Media).
- Accessing user profile: name, avatar, country (but not phone number — this is the key difference from WhatsApp).
- Webhook for incoming messages.
Main limitation: Viber does not pass the user's phone number to the bot. The identifier is a viber_id (a unique hash for each bot–user pair). To link to CRM, you need to ask the user to enter their phone number manually or use a "Share Contact" button (works only in some client versions).
Integration Architecture with Bitrix24
Viber Bot API (webhook)
↓
Bot server (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": "John Smith",
"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 your order number:",
"keyboard": {
"Type": "keyboard",
"Buttons": [
{"ActionType": "reply", "ActionBody": "operator", "Text": "Contact operator"}
]
}
}
Client Identification Without a Phone Number
The absence of a phone number in the Viber profile requires a separate verification scenario:
- The bot greets the user and asks them to enter their phone number.
- The user enters the number in
+...format. - The bot sends an SMS verification code via an SMS provider.
- The user enters the code → the bot links
viber_idto the CRM contact in the fieldUF_CRM_VIBER_ID. - On subsequent interactions — identification is by
viber_idwithout re-entering the phone number.
Alternative for corporate scenarios: the "Share Contact" button in Viber (type share-phone). It does not work in all client versions, but when it does — the phone number is passed automatically.
Integration with Bitrix24 Open Lines
Viber connects to open lines natively: CRM → Contact Center → Viber. This is a no-code path — messages from Viber go into the operator queue.
For more complex scenarios (bot + operator), a hybrid scheme is used:
- The bot's own server handles automatable requests.
- When transferring to an operator — the bot sends a message to the open line via
imopenlines.chat.sendMessageor creates a chat viaim.chat.addand adds the history.
Case: Viber Bot for a Food Delivery Service
Task: a cafe chain, primary audience uses Viber. Needs to take delivery orders without a phone call and confirm via the bot.
Order scenario via Carousel:
- Client writes "Order" → bot shows menu categories as buttons.
- Item selection via Rich Media Carousel (cards with photo, price, "+" button).
- Cart stored in Redis by
viber_id. - Delivery address entry → delivery zone verification.
- Payment: "Pay online" button → link to payment page.
- After payment: create a deal in Bitrix24 via
crm.deal.addwith status "Accepted", responsible = location manager. - Order confirmation and tracking via Viber notifications (
send_messageon deal stage change).
Note: 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 within the first two months. The average order value through the bot was 12% higher — clients browse and add items at their own pace.
| 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 |







