Rich Messaging
Quick Replies
Quick Replies offer the customer a choice of responses to the last agent or last chat bot message in the transcript. Tapping or clicking one of these Quick Replies posts that reply back to the agent as a text message. This saves the customer from having to type a response manually.
Quick Replies are very flexible. A chat bot or agent can provide context-sensitive quick replies that aid in making a selection, polite responses (such as "OK", "Thank you", "Yes, please" in the customer's native language), numeric responses, or choose from a set of preset time slots.
JSON Examples
Quick Replies are attached to standard chat message objects by adding a few additional properties:
- type - The type of message object received. For quick replies, the value will be "Message".
- contentType - The type of rich message content attached to the message. For quick replies, the value will be "quick-replies".
- content - An array of rich message content and other attachments. For quick replies, this will contain quick reply objects.
Top level of message object
Note, this example is only showing properties related to quick replies. All other properties normally included inside a message object have been omitted.
{
"type": "Message",
"contentType": "quick-replies",
"messageType": "text",
"text": "Will 3:00PM tomorrow work for you?",
"content": [
{"id": 1, "type": "quick-reply", "action": "message","text": "Sounds Good."},
{"id": 2, "type": "quick-reply", "action": "message","text": "No, sorry."},
{"id": 3, "type": "quick-reply", "action": "message","text": "What else?"}
]
}
Generic Templates
Generic Templates allow you to craft custom cards with an array of different components like buttons, link, and text.
You may craft your generic templates in many different ways. You can send a generic template that appears only as a clickable image, or you can send a video the same way. You may add or omit any property or component to build your generic template the way you want.
JSON Examples
Generic Templates are attached to standard chat message objects by adding a few additional properties:
- type - The type of message object received. For generic templates, the value will be "Structured".
- contentType - The type of rich message content attached to the message. For generic templates, the value will be "generic".
- content - An array of rich message content and other attachments. For generic templates, this will contain generic template objects.
Top level of message object
Note, this example is only showing properties related to generic templates. All other properties normally included inside a message object have been omitted.
{
"type": "Structured",
"contentType": "generic",
"messageType": "text",
"text": "",
"content": [
{
"id": "987a6c84-ada0-468f-86e1-e9ea715b8c32",
"title": "50% off Flights to Norway",
"desc": "Valid September to November only",
"image": "https://media1.tenor.com/images/6191ba63359dba8a0ef18f178616c2cd/tenor.gif",
"video": "",
"actions": {
"url": "http://www.samplesite.com/flights/norway",
"urlTarget": "__ARCH"
},
"components": [
{
"id": "0",
"type": "button",
"text": "View Details",
"title": "View Details",
"actions": {
"url": "http://www.samplesite.com/flights/norway",
"urlTarget": "__BLANK"
}
},
{
"id": "1",
"type": "button",
"text": "Book Now",
"title": "Book Now",
"actions": {
"url": "http://www.samplesite.com/flights/norway/book",
"urlTarget": "__BLANK"
}
}
]
}
]
}