Надіслати вхідне повідомлення
Посібник з інтеграції мобільного додатку
Надіслати вхідне повідомлення
Надсилає вхідний SMS або WhatsApp-повідомлення, отримані пристроєм, до вхідних на сервері.
Тіло запиту
| Поле | Тип | Опис | |
|---|---|---|---|
| from_phone | string | обов'язково | Номер телефону відправника (цифри та + дозволені). |
| message | string | обов'язково | Текст повідомлення. |
| channel | string | необов'язково | sms або whatsapp. За замовчуванням sms. |
Приклад запиту
cURL
curl -X POST "https://api.rcszilla.com/?endpoint=submit_reply" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR-DEVICE-TOKEN" \
-d '{
"from_phone": "+40712345678",
"channel": "sms",
"message": "YES please send me more info"
}'
Відповідь
{
"success": true,
"message": "Reply received",
"id": 209,
"reply": null,
"reply_queue_id": null
}
{
"success": true,
"message": "Reply received",
"id": 209,
"reply": "Thanks for your message! We will get back to you shortly.",
"reply_queue_id": 315
}
Якщо
reply не null у відповіді, додаток має надіслати цей текст на from_phone по тому самому каналу, а потім викликати mark_sent з reply_queue_id.Auto-reply Flow
- App receives inbound SMS/WhatsApp.
- App calls
submit_reply. - Server matches message against auto-reply rules.
- If matched ?server queues the reply and returns
"reply"text inline. - App sends the reply text directly to the sender (no second poll needed).
- App calls
mark_sentwithreply_queue_idto confirm delivery.