Integrating SMS.ru SMS service with Bitrix24

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
    1173
  • 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
    745
  • 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

SMS.ru Service Integration with Bitrix24

A typical situation: a company sends transactional SMS through SMS.ru — order confirmations, authorization codes, delivery notifications. CRM works in Bitrix24. Managers switch between two systems, marketing broadcasts live separately from the sales funnel, and no one tracks delivery statuses. Integration brings everything into one window: SMS are sent directly from CRM, statuses are returned, analytics are collected in one place.

Provider Registration via messageservice.sender.add

Bitrix24 works with SMS providers through the messageservice module. For SMS.ru to appear in the list of available services, it must be registered via REST API:

messageservice.sender.add({
  CODE: "smsru",
  TYPE: "SMS",
  HANDLER: "https://your-domain.com/handler/smsru.php"
})

HANDLER — URL of a script that receives requests from Bitrix24 and forwards them to the SMS.ru API. Bitrix24 sends a POST request with fields: recipient number (message_to), message text (message_body), message identifier (message_id).

Handler on your side:

  1. Receives data from Bitrix24.
  2. Forms a request to SMS.ru API: https://sms.ru/sms/send?api_id=YOUR_KEY&to=NUMBER&msg=TEXT&json=1.
  3. Receives a response from SMS.ru with sms_id and status.
  4. Saves mapping message_id (Bitrix24) → sms_id (SMS.ru) for subsequent delivery tracking.
  5. Returns confirmation to Bitrix24.

After registration, the provider is available in CRM robots, in manual SMS sending from a card, and in CRM marketing.

Webhook for Delivery Statuses

SMS.ru supports callback notifications when a message status changes. In the SMS.ru personal account, a handler URL is set that will receive POST requests when the status changes:

  • 100 — message in queue
  • 101 — transferred to operator
  • 102 — delivered
  • 103 — not delivered (expired)
  • 104 — not delivered (error)

The handler receives sms_id and status, finds the associated message_id from Bitrix24, and calls the status update method in Bitrix24. Without this mechanism, all messages in CRM will show "Sent" status even if the subscriber is actually unavailable.

In practice, callback from SMS.ru arrives with a delay of several seconds to a minute. For critical scenarios (payment confirmation), additionally configure polling via the sms.ru/sms/status method with a check by sms_id every 30 seconds.

Transactional and Marketing SMS

The separation is important both technically and legally.

Transactional SMS — notifications tied to a customer action: order confirmation, delivery status change, appointment reminder. Sent automatically via CRM robots:

  • Deal moves to "Confirmed" stage → "Send SMS" robot → text with order number and amount
  • Record in "Appointment" smart process moved to "One day before" stage → SMS reminder

For transactional SMS in SMS.ru, the standard sending route is used. The sender name (alphanumeric sender ID) is registered in the SMS.ru personal account and confirmed by documents.

Marketing SMS — broadcasts to the base: promotions, special offers, reactivation. Sent via Bitrix24 CRM marketing: contact segment → create SMS broadcast → select SMS.ru provider → send.

Key differences:

Parameter Transactional Marketing
Initiator Customer action (order, appointment) Company (broadcast to base)
Consent Implied with order placement Mandatory opt-in
Cost Standard SMS.ru tariff SMS.ru tariff (same, but higher volume)
Setup in Bitrix24 CRM robots / business processes CRM marketing section
Limitation No quantity limit SMS.ru may limit frequency

Automation via CRM Robots

Robots are the primary tool for automatic sending. Configure typical scenarios:

Sales funnel:

  • New lead → SMS "Thank you for contacting us, a manager will reach out within 15 minutes"
  • Deal at "Awaiting Payment" stage → SMS with payment link (substitute #DEAL_UF_PAYMENT_LINK#)
  • Deal closed successfully → SMS with thanks and request to leave a review

Automation outside the funnel:

  • Missed call (trigger) → SMS "We noticed your call, we will call back"
  • Contact's birthday (scheduled business process) → congratulatory SMS

The robot text has access to CRM fields: #CONTACT_NAME#, #DEAL_TITLE#, #DEAL_OPPORTUNITY#, custom fields via #DEAL_UF_XXX#.

Cost Optimization

SMS.ru charges by the number of segments (1 SMS = 70 characters in Cyrillic or 160 in Latin). Ways to reduce costs:

  • Short templates. Every extra character after 70 is a second segment. Template "Your order #{ORDER} for {SUM} rub. confirmed. Delivery {DATE}." — 80 characters, two segments. Remove "rub.", abbreviate — 68 characters, one segment. 50% savings per message.
  • Duplicate filtering. A robot can trigger twice on stage rollback. Add a condition to the robot: send only if custom field UF_CRM_SMS_SENT is empty, after sending record the date.
  • Number verification. SMS.ru returns an error when sending to an invalid number but still charges for the attempt. Before a mass broadcast, run the base through sms.ru/sms/cost — the method returns the cost without sending, allowing you to identify invalid numbers.

Implementation Timeline

Scale Includes Timeline
Basic SMS.ru connection, one robot, manual sending from card 3–5 days
Standard 3–5 robots by stages, callback statuses, templates with substitution 1 week
Extended Mass broadcasts via CRM marketing, status polling, duplicate filtering, analytics 1.5–2 weeks

What We Configure

  • SMS.ru registration as provider via messageservice.sender.add
  • Handler for Bitrix24 requests → SMS.ru API
  • Callback handler for delivery statuses
  • Alphanumeric sender ID (sender name)
  • CRM robots for transactional SMS by sales funnel stages
  • Mass broadcasts via CRM marketing
  • SMS templates with CRM field substitution
  • Verification and normalization of phone numbers in the base
  • Testing: sending from a card, robot execution, callback receipt, mass broadcast to test segment