В этой статье представлены основные примеры сообщений, которые можно отправить с помощью edna API, с указанием операторов и типов отправляемого контента.
SMS-сообщение
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "smsContent": { "contentType": "TEXT", "text": "Добрый день! Дмитрий" } } }
Whatsapp чат-сообщение
- Текст
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Добрый день! Рады представить Вам наш новый канал взаимодействия с клиентами. Здесь вы можете задавать все интересующие вас вопросы." } } }
- Картинка
ВАЖНО! Если при отправке чат-сообщения WhatsApp указано поле attachment, то поле text игнорируется. Отправляется только вложение.
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "IMAGE", "attachment": { "url": "https://www.gstatic.com/webp/gallery/1.jpg", "name": "Lorem Ipsum" } } } }
- Документ
ВАЖНО! Если при отправке чат-сообщения WhatsApp указано поле attachment, то поле text игнорируется. Отправляется только вложение.
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "DOCUMENT", "attachment": { "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "name": "Lorem Ipsum" } } } }
- Видео
ВАЖНО! Если при отправке чат-сообщения WhatsApp указано поле attachment, то поле text игнорируется. Отправляется только вложение.
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "VIDEO", "attachment": { "url": "https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_480_1_5MG.mp4", "name": "Lorem Ipsum" } } } }
- Аудио
ВАЖНО! Если при отправке чат-сообщения WhatsApp указано поле attachment, то поле text игнорируется. Отправляется только вложение.
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "AUDIO", "attachment": { "url": "https://dl.espressif.com/dl/audio/ff-16b-2c-44100hz.aac", "name": "Lorem Ipsum" } } } }
- Геолокация
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "LOCATION", "location": { "longitude": "163", "latitude": "48", "address": "г. Москва, ул Правды, д 3" } } } }
- С интерактивным меню
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "LIST_PICKER", "text": "Здравствуйте, пожалуйста, выберите, какого цвета худи вы хотите", "listPicker": { "button": "Цвета худи", "sections": [ { "title": "Выберите цвет", "items": [ { "identifier": "1", "title": "Red", "subtitle": "Худи Матрица L красная" }, { "identifier": "2", "title": "Blue", "subtitle": "Худи Матрица L синяя" } ] } ] } } } }
- С кнопками ответа
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Здравствуйте, пожалуйста, выберите, какого цвета худи вы хотите", "keyboard": { "rows": [ { "buttons": [ { "text": "Красный", "payload": "1" }, { "text": "Синий", "payload": "2" }, { "text": "зелёный", "payload": "3" } ] } ] } } } }
- С одним товаром
{ "requestId": "test-001", "cascadeId": "3", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "content": { "whatsappContent": { "contentType": "PRODUCT", "header": { "text": "какой-то футер" }, "text": "Выберите лучшее предложение", "catalog": { "id": "377932094379589", "product": { "id": "yxtgwrkdy9" } } } } }
- С группой товаров
{ "requestId": "test-001", "cascadeId": "8", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "content": { "whatsappContent": { "contentType": "PRODUCT_LIST", "header": { "text": "какой-то футер" }, "text": "Выберите лучшее предложение", "catalog": { "id": "377932094379589", "sections": [ { "title": "Shoes", "products": [ { "id": "yxtgwrkdy9" }, { "id": "5k0l3pwczd" } ] }, { "title": "Shirts", "products": [ { "id": "5k0l3pwczd" } ] } ] } } } }
Whatsapp HSM-сообщение
- Текст и подпись
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Приветствуем! Напишите нам, чтобы познакомиться с функциями edna", "footer": { "text": "Спасибо за интерес" } } } }
- Текст, заголовок-текст и подпись
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Приветствуем! Напишите нам, чтобы познакомиться с функциями edna", "header": { "text": "Ваш чат с edna" }, "footer": { "text": "Спасибо за интерес" } } } }
- Текст и заголовок-картинка
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Приветствуем! Напишите нам, чтобы познакомиться с функциями edna", "header": { "imageUrl": "https://cdn.maikoapp.com/3d4b/4qgko/200.jpg" } } } }
- Текст и заголовок-картинка и подпись
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Текст и заголовок-картинка и подпись", "header": { "imageUrl": "https://www.gstatic.com/webp/gallery/1.jpg" }, "footer": { "text": "Ждем вас!" } } } }
- Текст и заголовок-файл
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Приветствуем! Напишите нам, чтобы познакомиться с функциями edna", "header": { "documentUrl": "https://cdn.maikoapp.com/3d4b/4qgko/200.jpg" } } } }
- Текст и заголовок-файл и подпись
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Приветствуем! Напишите нам, чтобы познакомиться с функциями edna", "header": { "documentUrl": "https://cdn.maikoapp.com/3d4b/4qgko/200.jpg" }, "footer": { "text": "Спасибо за интерес" } } } }
- Текст и заголовок-видео и подпись
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Текст и заголовок-видео и подпись", "header": { "videoUrl": "https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_480_1_5MG.mp4" }, "footer": { "text": "Ждем вас!" } } } }
- Текст и 2 чат-кнопки
{ "requestId": "test-001", "cascadeId": "11", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Приветствуем! Напишите нам, чтобы познакомиться с функциями edna", "keyboard": { "rows": { "buttons": [ { "text": "Привет!", "buttonType": "QUICK_REPLY", "payload": "1" }, { "text": "Пока", "buttonType": "QUICK_REPLY", "payload": "2" } ] } } } } }
- Текст и кнопка-ссылка
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Приветствуем! Напишите нам, чтобы познакомиться с функциями edna", "keyboard": { "rows": { "buttons": [ { "text": "Нажимай!", "buttonType": "URL", "url": "https://raskladki.net.ru/ru/" } ] } } } } }
- Текст и кнопка-звонок
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "whatsappContent": { "contentType": "TEXT", "text": "Приветствуем! Напишите нам, чтобы познакомиться с функциями edna", "keyboard": { "rows": { "buttons": [ { "text": "Звони!", "buttonType": "PHONE", "phone": "79000000000" } ] } } } } }
Viber-сообщения
- Текст
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "viberContent": { "contentType": "TEXT", "text": "Новый текст совершенно" } } }
- Картинка
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "viberContent": { "contentType": "IMAGE", "attachment": { "url": "https://www.gstatic.com/webp/gallery/1.jpg", "name": "Lorem Ipsum" } } } }
- Документ
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "viberContent": { "contentType": "DOCUMENT", "attachment": { "url": "https://www.gstatic.com/webp/gallery/1.jpg", "name": "Lorem Ipsum" } } } }
- Сообщение с кнопкой и картинкой
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "viberContent": { "caption": "Название кнопки", "action": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "text": "Текст сообщения", "contentType": "BUTTON", "attachment": { "url": "https://www.gstatic.com/webp/gallery/1.jpg", "name": "Lorem Ipsum" } } } }
- Отправка SMS-сообщение с резервированием Viber-сообщением
{ "requestId": "test-001", "cascadeId": "1", "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2021-01-21T08:00:00Z", "content": { "smsContent": { "contentType": "TEXT", "text": "Новый текст SMS" }, "viberContent": { "contentType": "TEXT", "text": "Новый текст VIBER" } } }
Пуш-сообщение
{ "requestId": "test-001", "cascadeId": 111, "subscriberFilter": { "address": "79000000000", "type": "PHONE" }, "startTime": "2022-01-21T08:00:00Z", "content": { "pushContent": { "small": { "text": "Заберите её в отделении банка", "title": "Карта готова", "imageUrl": "https://.png" }, "big": { "title": "Карта готова", "text": "Заберите её в отделении банка", "imageUrl": "https://.png" }, "buttons": [ { "text": "Поддержка", "url": "DeeplinkSupport" }, { "text": "Напомнить позже", "url": "DeeplinkLater" } ], "action": "DeeplinkMainPush", "effects": { "vibrate": "[500,100,500,150,50,50]", "lights": "#770808", "sound": "AthlonRoar", "androidNotificationChannel": "Статус заказа" }, "iosSettings": { "interruptionLevel": "ACTIVE", "category": "ednaPushCategory" } } } }