--> --> --> -->

Примеры сообщений

Статья содержит примеры сообщений с разным содержанием, которые можно отправить с помощью 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

Если при отправке чат-сообщения WhatsApp указано поле attachment, поле text игнорируется. Отправляется только вложение.

Сообщение с текстом:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "79000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "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"
            }
        }
    }
}

Сообщение с документом:

{
    "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"
            }
        }
    }
}

Сообщение с видео:

{
    "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"
            }
        }
    }
}

Сообщение с аудио:

{
    "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",
                "name": "ООО Компания"
            }
        }
    }
}

Сообщение с интерактивным меню:

{
    "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": "Кроссовки",
                        "products": [
                            {
                                "id": "yxtgwrkdy9"
                            },
                            {
                                "id": "5k0l3pwczd"
                            }
                        ]
                    },
                    {
                        "title": "Футболки",
                        "products": [
                            {
                                "id": "5k0l3pwczd"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

HSM-сообщение WhatsApp

Сообщение с текстом и подписью:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "79000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Здравствуйте! Напишите нам, чтобы познакомиться с возможностями edna Pulse",
            "footer": {
                "text": "Компания edna"
            }
        }
    }
}

Сообщение с текстом, заголовком-текстом и подписью:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "79000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Здравствуйте! Напишите нам, чтобы познакомиться с возможностями edna Pulse",
            "header": {
                "text": "Ваш чат с компанией edna"
            },
            "footer": {
                "text": "Компания edna"
            }
        }
    }
}

Сообщение с текстом и заголовком-изображением:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "79000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Здравствуйте! Напишите нам, чтобы познакомиться с возможностями edna Pulse",
            "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 Pulse",
            "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 Pulse",
            "header": {
                "documentUrl": "https://cdn.maikoapp.com/3d4b/4qgko/200.jpg"
            },
            "footer": {
                "text": "Компания edna"
            }
        }
    }
}

Сообщение с текстом, заголовком-видео и подписью:

{
    "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": "Ждем вас!"
            }
        }
    }
}

Сообщение с текстом и двумя чат-кнопками:

{
    "requestId": "test-001",
    "cascadeId": "11",
    "subscriberFilter": {
        "address": "79000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Здравствуйте! Напишите нам, чтобы познакомиться с возможностями edna Pulse",
            "keyboard": {
                "rows": {
                    "buttons": [
                        {
                            "text": "Написать",
                            "type": "QUICK_REPLY",
                            "payload": "1"
                        },
                        {
                            "text": "Позже",
                            "type": "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, чтобы познакомиться с возможностями edna Pulse",
            "keyboard": {
                "rows": {
                    "buttons": [
                        {
                            "text": "Перейти",
                            "type": "URL",
                            "url": "https://docs.edna.by/"
                        }
                    ]
                }
            }
        }
    }
}

Сообщение с текстом и кнопкой-звонком:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "79000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Здравствуйте! Позвоните нам, чтобы познакомиться с возможностями edna Pulse",
            "keyboard": {
                "rows": {
                    "buttons": [
                        {
                            "text": "Позвонить",
                            "type": "PHONE",
                            "phone": "79000000000"
                        }
                    ]
                }
            }
        }
    }
}

Авторизационное сообщение с кнопкой копирования одноразового пароля:

{
    "requestId": "test-001",
    "cascadeId": "71",
    "subscriberFilter": {
        "address": "79000000000",
        "type": "PHONE"
    },
    "content": {
        "whatsappContent": {
            "contentType": "AUTHENTICATION",
            "messageMatcherId": 4601,
            "text": "1234"
        }
    }
}

Сообщение 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"
        }
    }
}

Сообщение Push

Сообщение с текстом и кнопками:

{
    "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"
            }
        }
   

Сообщение OK Notify

Сообщение с текстом:

{
    "requestId": "{{$guid}}",
    "cascadeId": "31759",
    "comment": "",
    "subscriberFilter": {
        "address": "70000000000",
        "type": "PHONE"
    },
    "content": {
        "okNotifyContent": {
            "contentType": "TEXT",
            "text": "Текст для сообщения OK Notify"
        }
    }
}

Сообщение VK Notify

Сообщение с кнопками:

{
    "requestId": "{{$guid}}",
    "cascadeId": "31778",
    "comment": "",
    "subscriberFilter": {
        "address": "70000000000",
        "type": "PHONE"
    },
    "content": {
        "vkNotifyContent": {
            "contentType": "TEXT",
            "text": "Сообщение с кнопками",
            "keyboard": {
                "rows": [
                    {
                        "buttons": [
                            {
                                "text": "Кнопка 1",
                                "buttonType": "QUICK_REPLY",
                                "payload": "qwerty1",
                                "color": "positive"
                            },
                            {
                                "text": "Кнопка 2",
                                "buttonType": "QUICK_REPLY",
                                "payload": "qwerty2",
                                "color": "negative"
                            },
                            {
                                "text": "Кнопка 3",
                                "buttonType": "QUICK_REPLY",
                                "payload": "qwerty3",
                                "color": "primary"
                            },
                            {
                                "text": "Перейти",
                                "buttonType": "URL",
                                "url": "https://edna.ru",
                                "payload": "qwerty4"
                            },
                            {
                                "buttonType": "LOCATION",
                                "payload": "qwerty5"
                            },
                            {
                                "text": "Приложения",
                                "buttonType": "VK_MINI_APPS",
                                "payload": "qwerty6",
                                "hash": "#edna",
                                "appId": 36637,
                                "ownerId": 7481938
                            }
                        ]
                    }
                ]
            },
            "messageMatcherId": 5675
        }
    }
}