Используйте вебхуки для получения событий сообщений немедленно в вашей системе.
Доступны два типа вебхуков:
Настройте этот вебхук в настройках устройства для получения обновлений статуса без опроса API.
{
"sms_id": int,
"status_id": int,
"status_message": string,
"sendto": string,
"senttime": datetime,
"channel_id": int,
"device_id": int
}
Настройте этот вебхук для пересылки входящих сообщений в CRM, хелпдеск или бэкенд.
The payload includes a "type" field that indicates whether the incoming message is a text message or an image (e.g. from WhatsApp).
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"
}
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: