Api огляд webhook : інтеграція та автоматизація

Вебгаки

Use webhooks to receive message events immediately in your system.

Two webhook types are available:

  1. Delivery status webhook for outgoing messages.
  2. Incoming message webhook for SMS and other supported channels.

1. Delivery status webhook

Configure this webhook in device settings to receive status updates without polling the API.

{
  "sms_id": int,
  "status_id": int,
  "status_message": string,
  "sendto": string,
  "senttime": datetime,
  "channel_id": int,
  "device_id": int
}
  • 1 - В очікуванні SMS
  • 2 - SMS взято по телефону
  • 3 - У черзі для надсилання. Certainly, it would have been more logical to place the status "queued for sending" before "SMS taken by phone," but for backward compatibility, the statuses are in the following order: 1, 3, 2."
  • 5 - Вхідні SMS
  • 6 - SMS відправлено телефоном
  • 7 - SMS доставлено
  • 8 - SMS НЕ доставлено
  • 9 - SMS, узагалі не визначено - загальна помилка. (Прочитайте що робити з цією помилкою сюди)
  • Можливо менш поширені помилки:
  • 10 - SMS не надіслано - No Service
  • 11 - SMS не надіслано - Null PDU
  • 12 - SMS не надіслано - Radio Off
  • 100, 101 - SMS не надіслано - NOT ALLOWED. (Дозволи на надсилання SMS у програмі не надано)

2. Incoming message webhook

Configure this webhook to forward incoming messages to your CRM, helpdesk or backend.

The payload includes a "type" field that indicates whether the incoming message is a text message or an image (e.g. from WhatsApp).

Text message (type = "text")

Sent for incoming SMS and incoming text messages from WhatsApp / WhatsApp Business / RCS.

{
  "address": string,
  "date": datetime,
  "date_sent": datetime,
  "body": string,
  "internal_id": int,
  "channel_id": int,
  "sms_id": int,
  "device_id": int,
  "device_name": string,
  "type": "text"
}

Image message (type = "img")

Sent for incoming images from WhatsApp / WhatsApp Business. The image is already uploaded to our S3 storage — your backend only needs to store the URL, no need to download and re-upload the file.

{
  "address": string,
  "date": datetime,
  "date_sent": datetime,
  "body": "",
  "internal_id": null,
  "sim": int,
  "sms_id": int,
  "type": "img",
  "img_url": "https://smsgateway24.s3.eu-central-1.amazonaws.com/..."
}

Notes:

  • "img_url" is a permanent public link to the image stored on our S3 bucket.
  • "body" is empty and "internal_id" is null for image messages — use "sms_id" as the unique identifier.
  • The webhook URL is taken from the same channel slot setting as text messages (WhatsApp = slot 3, WhatsApp Business = slot 2).
Webhook availability depends on your subscription plan.