Message Examples

The article provides examples of messages with different content that can be sent using the edna API.

SMS Messages

A message with text:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "smsContent": {
            "contentType": "TEXT",
            "text": "Hello Maria!"
        }
    }
}

WhatsApp Chat Messages

If the attachment field is specified when sending a WhatsApp chat message, the text field will be ignored. Only the attachment will be sent.

A message with text:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello! We are pleased to introduce you to our new customer communication channel. Here you can ask all the questions you are interested in."
        }
    }
}

A message with an image:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "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"
            }
        }
    }
}

A message with a file:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "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"
            }
        }
    }
}

A message with video:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "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"
            }
        }
    }
}

A message with audio:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "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"
            }
        }
    }
}

A message with geolocation:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "LOCATION",
            "location": {
                "longitude": "33.022617",
                "latitude": "34.707130",
                "address": "10 Parni, Limassol, Cyprus",
                "name": "Company LTD"
            }
        }
    }
}

A message with an interactive menu:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "LIST_PICKER",
            "text": "Hello! Please select a hoodie color",
            "listPicker": {
                "button": "Hoodie color",
                "sections": [
                    {
                        "title": "Select a color",
                        "items": [
                            {
                                "identifier": "1",
                                "title": "Red",
                                "subtitle": "Matrix Hoodie L in red"
                            }
                            {
                                "identifier": "2",
                                "title": "Blue",
                                "subtitle": "Matrix Hoodie L in blue"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

A message with response buttons:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "79000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello! Please select a hoodie color",
            "keyboard": {
                "rows": [
                    {
                        "buttons": [
                            {
                                "text": "Red",
                                "payload": "1"
                            },
                            {
                                "text": "Blue",
                                "payload": "2"
                            },
                            {
                                "text": "Green",
                                "payload": "3"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

A message with a product:

{
    "requestId": "test-001",
    "cascadeId": "3",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "content": {
        "whatsappContent": {
            "contentType": "PRODUCT",
            "header": {
                "text": "Footer"
            },
            "text": "Choose the best offer",
            "catalog": {
                "id": "377932094379589",
                "product": {
                    "id": "yxtgwrkdy9"
                }
            }
        }
    }
}

A message with a group of products:

{
    "requestId": "test-001",
    "cascadeId": "8",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "content": {
        "whatsappContent": {
            "contentType": "PRODUCT_LIST",
            "header": {
                "text": "Footer"
            },
            "text": "Choose the best offer",
            "catalog": {
                "id": "377932094379589",
                "sections": [
                    {
                        "title": "Shoes",
                        "products": [
                            {
                                "id": "yxtgwrkdy9"
                            },
                            {
                                "id": "5k0l3pwczd"
                            }
                        ]
                    },
                    {
                        "title": "T-shirts",
                        "products": [
                            {
                                "id": "5k0l3pwczd"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

WhatsApp HSM Messages

A message with text and a signature:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello there! Write to us to learn more about the capabilities of edna Pulse",
            "footer": {
                "text": "edna company"
            }
        }
    }
}

A message with text, a text header and a signature:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello there! Write to us to learn more about the capabilities of edna Pulse",
            "header": {
                "text": "Your chat with edna"
            },
            "footer": {
                "text": "edna company"
            }
        }
    }
}

A message with text and an image header:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello there! Write to us to learn more about the capabilities of edna Pulse",
            "header": {
                "imageUrl": "https://cdn.maikoapp.com/3d4b/4qgko/200.jpg"
            }
        }
    }
}

A message with text, an image header and a signature:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Text, image header, signature",
            "header": {
                "imageUrl": "https://www.gstatic.com/webp/gallery/1.jpg"
            },
            "footer": {
                "text": "We look forward to seeing you!"
            }
        }
    }
}

A message with text and a file header:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello there! Write to us to learn more about the capabilities of edna Pulse",
            "header": {
                "documentUrl": "https://cdn.maikoapp.com/3d4b/4qgko/200.jpg"
            }
        }
    }
}

A message with text, a file header and a signature:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello there! Write to us to learn more about the capabilities of edna Pulse",
            "header": {
                "documentUrl": "https://cdn.maikoapp.com/3d4b/4qgko/200.jpg"
            },
            "footer": {
                "text": "edna company"
            }
        }
    }
}

A message with text, a video header and a signature:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Text, video header, signature",
            "header": {
                "videoUrl": "https://file-examples.com/wp-content/uploads/2017/04/file_example_MP4_480_1_5MG.mp4"
            },
            "footer": {
                "text": "We look forward to seeing you!"
            }
        }
    }
}

A message with text and two chat buttons:

{
    "requestId": "test-001",
    "cascadeId": "11",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello there! Write to us to learn more about the capabilities of edna Pulse",
            "keyboard": {
                "rows": {
                    "buttons": [
                        {
                            "text": "Write now",
                            "type": "QUICK_REPLY",
                            "payload": "1"
                        },
                        {
                            "text": "Later",
                            "type": "QUICK_REPLY",
                            "payload": "2"
                        }
                    ]
                }
            }
        }
    }
}

A message with text and a link button:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello! Visit the edna Knowledge Base to learn more about the features of edna Pulse",
            "keyboard": {
                "rows": {
                    "buttons": [
                        {
                            "text": "Open",
                            "type": "URL",
                            "url": "https://docs.edna.io/"
                        }
                    ]
                }
            }
        }
    }
}

A message with text and a call button:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello there! Call us to learn more about the capabilities of edna Pulse",
            "keyboard": {
                "rows": {
                    "buttons": [
                        {
                            "text": "Call",
                            "type": "PHONE",
                            "phone": "35000000000"
                        }
                    ]
                }
            }
        }
    }
}

Authorization message with a one-time password copy button:

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

Viber Messages

A message with text:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "viberContent": {
            "contentType": "TEXT",
            "text": "Hello! We are pleased to introduce you to our new customer communication channel. Here you can ask all the questions you are interested in."
        }
    }
}

A message with an image:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "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"
            }
        }
    }
}

A message with a file:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "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"
            }
        }
    }
}

A message with a button and an image:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "viberContent": {
            "caption": "Button name",
            "action": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
            "text": "Button text",
            "contentType": "BUTTON",
            "attachment": {
                "url": "https://www.gstatic.com/webp/gallery/1.jpg",
                "name": "Lorem Ipsum"
            }
        }
    }
}

An SMS message with a fallback Viber message:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "35000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "smsContent": {
            "contentType": "TEXT",
            "text": "New SMS text"
        },
        "viberContent": {
            "contentType": "TEXT",
            "text": "Новый текст VIBER"
        }
    }
}

Instagram Messenger

A message with text:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "350000000000000",
        "type": "INSTAGRAM_ID"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "instagramContent": {
            "contentType": "TEXT",
            "text": "Instagram text"
        }
    }
}

A message with an image:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "350000000000000",
        "type": "INSTAGRAM_ID"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "instagramContent": {
            "contentType": "IMAGE",
            "attachment": {
                "url": "https://edna.ru/wp-content/uploads/2020/12/chat-czentr-480x480.jpg",
                "name": "Instagram IMAGE"
            }
        }
    }
}