The text displayed to the user.
If SSML is not provided in the same response, voice channels will also speak the text aloud as speech.
Voice channels will speak aloud contents in the SSML using speech.
Items are lists of UI elements that users can interact with.
They will be displayed as card, carousel or list depending on the channel.
Actions are buttons for call-to-action and for driving conversion.
On platforms without button support, they will be rendered as links or text.
Some features are channel specific or not yet been implemented by Delight.
You can use
Text represents the textual content you wish to communicate to the user. It is a string and a required attribute.
On messaging channels, they will be printed as text on screen. On voice channels, they will be spoken out as speech.
When returning a response, you can use a subset of the Speech Synthesis Markup Language (SSML) in your response . By using SSML, you can make the conversation response seem more like natural speech by adding cues for pronunciation and pauses. You can also play audio files in SSML.
The textual content inside SSML can be different than text, as you may wish to have a simple UI experience around text, while the output speech can provide a more detailed, read-aloud response.
When you are using both text and SSML fields, text will be printed on screen while the output speech will come from SSML.
Items is an array of UI elements your users can interact with. They are rendered as cards, carousel, list or similar UI elements depending on the channel.
Because different channels support different UI elements, our system adaptively selects the most suitable element on each channel to render your list. In general, our selection heuristics are as follows:
- If items contain only 1 object, it will be rendered as a card or the closest equivalent depending on the channel.
- If items contain more than 1 object but less than 10 objects (varies across and subject to each channel), it will be rendered as carousel or closest.
- If items contain more than 10 objects (varies across and subject to each channel), it will be rendered as list or closest.
For platforms that do not support cards or carousels or lists, we render items as text or speech. Users can then say or message the item title to select the item.
Each object in items has the following scheme:
Actions is an array of action objects. An action can serve as
- A text hint for users (what to say or type)
- A call-to-action button for users to click
Actions help guide users on what their next interaction could be, and drive the conversation forward.
User will be redirected to the link when they click the button.
The channel will send back a postback event when the user clicks the button.
Those button can be use together like below:
Override field allows developer to perform customize response in 2 scenarios:
For example, Delight does not support send attachment to facebook at this moment. You can find the raw response from facebook documentation and send it with override field.
In this example, we are going to send attachment from URL. We go here https://developers.facebook.com/docs/messenger-platform/send-messages#url to find the response format.
All we need is the content within the
So the Delight response will be like this: