Rich Media Advanced
Following is the JSON format for rich media in the Conversation node.
Use the advanced tab when you want more control than is possible from the rich media tab.
Text Only Attachment
Set the payload content type to TEXT.
Add the text to the payload message parameter.
{
"payload": {"contentType": "TEXT","object": {"message": "How can we help you today?"}}
}
File Attachment with Text
Set the payload content type to IMAGE.
Where the file is addressed as a public URL, add the address to the image parameter.
Optionally, add a text message to the payload message parameter.
{
"payload": {"contentType": "IMAGE","object": {"message": "Welcome","image": "https://www.freeiconspng.com/img/44207","title": "Logo"}}
}
Where the file is addressed by ID, add the file ID to the payload image parameter and the attachments parameter.
In the payload image parameter value, prefix the file ID with attachment://
{
"payload": {"contentType": "IMAGE","object": {"message": "Welcome","image": "attachment://edba2868-e75c-4b94-ac89-470e495b8ece","title": "Step1"}},"attachments": ["edba2868-e75c-4b94-ac89-470e495b8ece"]
}
Rich Media
Add rich media to TEXT or IMAGE content types.
Add rich media to the payload children object.
Add all files referenced by file ID, including those files in rich media, to the attachments parameter.
{
"payload": {"contentType":"TEXT","object": {"message": "How can we help you today?","children": []}},"attachments": []
}
Rich Media Link Button
See also Rich Media Message Buttons.
{
"payload": {"contentType": "TEXT","object": {"message": "This message includes a link to the Five9 website.","children" : [{"contentType": "LINK_BUTTON","object": {"text": "Click to visit the Five9 website","url": "https://www.five9.com/","default": false}}]}}
}
Rich Media Reply Buttons
See also Rich Media Message Buttons.
{
"payload": {"contentType": "TEXT","object": {"message": "Select from the following options.","children": [{"contentType": "REPLY_BUTTON","object": {"text": "Option One","response": "Clicked option one","image": "https://www.freeiconspng.com/img/44207","attributes": {"key": "value","boolean": true}}},{"contentType": "REPLY_BUTTON","object": {"text": "Option Two","response": "Clicked option two","image": "https://www.freeiconspng.com/img/345","attributes": {"key": "value","boolean": true}}}]}
}
}
Rich Media Postback Button
See also Rich Media Message Buttons.
Note that postback buttons use the postback webhook event, rather than the conversation:message event.
{
"payload": {"contentType": "TEXT","object": {"message": "Transfer to Agent","children" : [{"contentType": "POSTBACK_BUTTON","object": {"text": "Transfer to Agent","response": "QWERTY-1028434"}}]}}
}
Rich Media Location Button
See also Rich Media Message Buttons.
{
"payload": {"contentType": "TEXT","object": {"children": [{"contentType": "LOCATION_REQUEST_BUTTON","object": {"text": "Click to send us your location"}}]}
}
}