Examples of Messages for API

In this article, you can see examples of messages you can send via API for different channels.

SMS Messages

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

WhatsApp Chat Messages

When sending WhatsApp chat messages with attachments the text field is ignored. Only the attachment is sent.

Text:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello, we are happy to present our new client communicaiton channel. Here you can ask any questions you might have."
        }
    }
}

With an image attached:

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

With a document attached:

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

With a video file attached:

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

With an audio file attached:

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

With location attached:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "LOCATION",
            "location": {
                "longitude": "33.022617",
                "latitude": "34.707130",
                "address": "Limassol Marina St, Limassol 3014, Cyprus",
                "name": "Сompany name"
            }
        }
    }
}

With an interactive menu:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "LIST_PICKER",
            "text": "Hello, please choose what color hoodie you want",
            "listPicker": {
                "button": "Hoodie colors",
                "sections": [
                    {
                        "title": "Choose the color",
                        "items": [
                            {
                                "identifier": "1",
                                "title": "Red",
                                "subtitle": "Matrix Hoodie L in red"
                            },
                            {
                                "identifier": "2",
                                "title": "Blue",
                                "subtitle": "Matrix Hoodie L in blue"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

With reply buttons:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello, please choose what color hoodie you want",
            "keyboard": {
                "rows": [
                    {
                        "buttons": [
                            {
                                "text": "Red",
                                "payload": "1"
                            },
                            {
                                "text": "Blue",
                                "payload": "2"
                            },
                            {
                                "text": "Green",
                                "payload": "3"
                            }
                        ]
                    }
                ]
            }
        }
    }
}

Single product (commerce message):

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

Multi-product (commerce message):

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

WhatsApp HSM Messages

Text and a signature:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello! Contact us to learn more about edna functionality",
            "footer": {
                "text": "Thank you for your interest"
            }
        }
    }
}

Text, a text header, and a signature:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello! Contact us to learn more about edna functionality",
            "header": {
                "text": "Your chat with edna"
            },
            "footer": {
                "text": "Thank you for your interest"
            }
        }
    }
}

Text and an image header:

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

Text, an image header, and a signature:

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

Text and a document header:

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

Text, a document header, and a signature:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello! Contact us to learn more about edna functionality",
            "header": {
                "documentUrl": "https://cdn.maikoapp.com/3d4b/4qgko/200.jpg"
            },
            "footer": {
                "text": "Thank you for your interest"
            }
        }
    }
}

Text, a video header, and a signature:

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

Text and two chat buttons:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello! Contact us to learn more about edna functionality",
            "keyboard": {
                "rows": {
                    "buttons": [
                        {
                            "text": "Hi!",
                            "type": "QUICK_REPLY",
                            "payload": "1"
                        },
                        {
                            "text": "Bye",
                            "type": "QUICK_REPLY",
                            "payload": "2"
                        }
                    ]
                }
            }
        }
    }
}

Text and a link button:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "whatsappContent": {
            "contentType": "TEXT",
            "text": "Hello! Contact us to learn more about edna functionality",
            "keyboard": {
                "rows": {
                    "buttons": [
                        {
                            "text": "Click me!",
                            "type": "URL",
                            "url": "https://raskladki.net.ru/ru/"
                        }
                    ]
                }
            }
        }
    }
}

Text and a call button:

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

Authentication message with one-time password button:

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

Viber Messages

Text:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "viberContent": {
            "contentType": "TEXT",
            "text": "Brand new text"
        }
    }
}

With an image attached:

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

With a document attached:

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

Text, a button, and an image:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "viberContent": {
            "caption": "Click me!",
            "action": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
            "text": "Contact us to learn more about edna functionality",
            "contentType": "BUTTON",
            "attachment": {
                "url": "https://www.gstatic.com/webp/gallery/1.jpg",
                "name": "Lorem Ipsum"
            }
        }
    }
}

Sending an SMS message with a fallback Viber message:

{
    "requestId": "test-001",
    "cascadeId": "1",
    "subscriberFilter": {
        "address": "00000000000",
        "type": "PHONE"
    },
    "startTime": "2021-01-21T08:00:00Z",
    "content": {
        "smsContent": {
            "contentType": "TEXT",
            "text": "New text for SMS"
        },
        "viberContent": {
            "contentType": "TEXT",
            "text": "New text for VIBER"
        }
    }
}

Instagram Messenger

Text:

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

Image:

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