Developing a WhatsApp 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.
Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1175
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    811
  • 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
    564
  • image_bitrix-bitrix-24-1c_mirsanbel_458_0.webp
    Development based on 1C Enterprise for MIRSANBEL
    747
  • image_crm_dolbimby_434_0.webp
    Website development on CRM Bitrix24 for DOLBIMBY
    655
  • image_crm_technotorgcomplex_453_0.webp
    Development based on Bitrix24 for the company TECHNOTORGKOMPLEKS
    976

WhatsApp Bot Development with Bitrix24 Integration

WhatsApp is a closed platform. Official API access for business is only available through the WhatsApp Business API (Meta), and obtaining it directly is not straightforward: you need a verified Meta business account and an approved provider. Everything else involves unofficial libraries with a risk of being blocked. This is the first thing to understand before developing a bot.

Options for Connecting WhatsApp to Bitrix24

Official path — via a BSP provider: Meta does not distribute access to the WhatsApp Business API directly. It works through Business Solution Providers (BSP): 360dialog, Twilio, MessageBird, WABA.cloud, and others. The provider registers your number with WhatsApp Business and provides API keys.

Popular options for various markets:

  • Green API — a provider with fast registration and a ready-made module for Bitrix24.
  • Wazzup — native Bitrix24 integration, official app in the marketplace.
  • Chat2Desk — omnichannel service with WhatsApp and Bitrix24 support.

Direct integration via Green API + custom bot: Green API provides a REST interface to WhatsApp, bypassing Meta directly (via the web client). Technically this is not the official path; numbers periodically require re-authorization. But for mid-size businesses it is a working option.

Bot Architecture via Green API + Bitrix24

Client in WhatsApp
      ↓
Green API (webhook instanceId + apiTokenInstance)
      ↓
Bot server
      ↓ ↓
  Bot logic     Bitrix24 REST API
                (crm.lead.add, crm.contact.list, etc.)

Receiving incoming messages:

GET https://api.green-api.com/waInstance{instanceId}/receiveNotification/{apiTokenInstance}

Replying in WhatsApp:

POST https://api.green-api.com/waInstance{instanceId}/sendMessage/{apiTokenInstance}
{
  "chatId": "[email protected]",
  "message": "Hello! How can I help you?"
}

The Bitrix24 integration is identical to the Telegram bot: find contact by phone number, create lead, write activities to the timeline.

Key Differences from Telegram

Formatting. WhatsApp supports a limited set: italic, bold, strikethrough, monospace. No HTML tags, no Reply buttons (only buttons via official API Templates).

Buttons. In unofficial APIs (Green API), buttons are not available — only text menus: "Type 1 for order status, 2 to speak with an operator." Through the official WhatsApp Business API, Interactive Messages with buttons are available, but only within approved templates.

Message templates. The first message the bot sends to a client (not a reply to an incoming message) must use an approved Template Message. Templates go through Meta moderation — 24–72 hours. Free-form text in outbound messages — only in reply to an incoming message within 24 hours.

Media. WhatsApp handles images, documents, and voice messages well. The bot can accept photos (e.g., for a return request) and save them to Bitrix24 Drive via disk.folder.uploadfile.

Integration via the Ready-Made Wazzup Module

If there is no need for complex bot logic — it is simpler to use Wazzup or a similar service with a ready-made integration:

  1. Register in Wazzup, connect a WhatsApp number.
  2. Install the Wazzup app from the Bitrix24 marketplace.
  3. Configure mapping: incoming WhatsApp messages → open line → lead/deal in CRM.
  4. Operators reply directly from Bitrix24; the client receives the reply in WhatsApp.

Limitation: no custom bot logic. Routing to operators only.

Case: Delivery Status Notification Bot

Task: online store, 200–400 orders per day. Clients flood support with "where is my order" questions. An automated response is needed.

Solution: when the order status changes in CRM (deal stage) → webhook → bot server → send notification in WhatsApp via Green API.

def on_deal_stage_change(deal_id, new_stage):
    deal = bitrix.get_deal(deal_id)
    phone = deal['CONTACT_PHONE']
    whatsapp_id = f"{phone.replace('+', '')}@c.us"

    messages = {
        'ACCEPTED': 'Order accepted for processing. Order number: {order_num}',
        'SHIPPED': 'Order shipped. Tracking number: {track}',
        'DELIVERED': 'Order delivered. Thank you for your purchase!'
    }

    if new_stage in messages:
        green_api.send_message(whatsapp_id, messages[new_stage].format(**deal))

Additionally: the bot accepts an incoming reply "track" → replies with a tracking link. "Operator" → transfers to the support queue.

Result: support inquiries about delivery status decreased by 60% in the first two weeks.

Component Effort
Connecting Green API / Wazzup 4–8 h
Basic bot (text commands) 16–24 h
Bitrix24 CRM integration 8–16 h
Outbound notifications on CRM events 8–16 h
Receiving media and uploading to Drive 4–8 h
Deployment and monitoring 4–8 h