Integrating Bitrix24 with WhatsApp via Third-Party Gateways: Configuration, Automation, and Sales Use Cases
Integration via Third-Party Gateways
WhatsApp integration with Bitrix24 is implemented through external gateways that provide APIs for sending and receiving messages. The connection is established using Bitrix24's REST API and the third-party service’s webhook interfaces. Neither party offers a complete ready-made solution, so message logic, routing, and CRM control must be custom-configured.
Integration Steps
- Selecting a Gateway: Evaluate gateways based on criteria such as reliability, pricing, technical support, SLA, and geopolitical risk.
- Authentication: Acquire an API token and configure the webhook interface to receive messages from the gateway.
- Creating Bitrix24 Webhooks: Generate an inbound webhook with access rights to CRM objects such as leads, deals, contacts, and chat.
- Message Synchronization: Received messages are pushed to the Bitrix24 REST API for creating or updating entities.
- Outbound Message Handling: Replies from Bitrix24 users are delivered to the gateway via its API.
Sample Incoming Message Handling Scenario
An incoming message is received on the integration server from a customer via the gateway. Logic is as follows:
- Identify an existing contact by phone number or create a new one.
- Create a new inquiry or activate an open deal.
- Log the message as a comment or add it to an open line chat.
- Trigger a robot or business process, such as an automated reply or task assignment.
// Example of sending a message via Bitrix24 REST API
$url = 'https://example.bitrix24.com/rest/1/abc123/im.message.add.json';
$params = [
'DIALOG_ID' => 'chat1234',
'MESSAGE' => 'Thank you for your message. A specialist will contact you shortly.'
];
$response = file_get_contents($url . '?' . http_build_query($params));
Automation with Robots and Business Processes
Once incoming messages are synchronized with Bitrix24, native automation tools can be used flexibly:
- Trigger a robot in the “New Inquiry” stage based on a WhatsApp event
- Automatically assign tasks to managers
- Send WhatsApp template messages based on deal stage changes
- Integrate with pricing calculators and back-office systems
Sales and Customer Service Use Cases
In real-world implementations, WhatsApp integration is used in the following scenarios:
- Repeat sales through automated campaigns targeting existing customers
- Appointment and payment reminders via template messages
- Technical support request registration and SLA tracking
- Order feedback enabled through auto-responders and chatbots
Integration Setup Checklist
- Verified phone number and approved templates are connected to the gateway
- Bitrix24 webhooks are properly configured
- Access to Bitrix24 REST API resources is established: CRM, open lines, chat
- Server-side gateway routing logic is implemented
- All message types tested: inbound, outbound, multi-step sequences
Common Errors
- Using an unverified phone number or invalid templates
- Unhandled exceptions during message processing (missing retry logic)
- Deleting a Bitrix24 webhook without updating the gateway configuration
- Exporting personal data without user consent, posing compliance risks
- Failure to segment chat flows by manager, resulting in response conflicts
FAQ
- Can multiple WhatsApp numbers be used in Bitrix24?
- Yes, if each number is routed through a separate webhook and assigned to distinct open lines.
- How is reconnection handled if the gateway fails?
- Uses a message queue, retries, and server-side middleware error logging mechanisms.
- Where is the conversation history stored?
- Messages are stored in Bitrix24 CRM—either as comments under deals or within open lines. Optional server-side archiving is also possible.
- Can a business initiate a conversation with a customer?
- Depends on the gateway’s policies and WhatsApp Business API rules. Generally requires a pre-approved template and an active 24-hour conversation window.
- How are documents sent via WhatsApp?
- Through the gateway API’s media features. Typically requires uploading the file to a CDN and sending a link, or using a document template format.
Conclusion
Bitrix24 integration with WhatsApp via third-party gateways enables a robust and scalable messaging strategy for customer communication. Proper configuration enhances productivity in sales and support departments. Implementing REST APIs, webhook logic, and message state handling requires a well-planned architecture and thorough testing. For resilience and scalability, a dedicated middleware message processing server is recommended.
Need to discuss your integration scenario?
If you're considering integrating WhatsApp via a third-party gateway, a preliminary review may help clarify the scope and reduce implementation risks.
- Which gateway is being evaluated and are templates already approved?
- What CRM events should trigger automation logic?
- Do you require routing by number, department, or multi-account setup?