Features
Available components
Messenger channel supports all CSML components: Text
, Typing
, Wait
, Image
, Question
, Button
, Carousel
, Card
, Audio
, Video
, Url
, File
.
Special behaviors
Thumb up event
A "thumb up" button click is interpreted as a special Payload component event. CSML will receive the following data:
Buttons and quick replies
Messenger differentiates between several types of buttons. Currently, CSML Studio will allow you to send either regular or quick_reply buttons.
Regular buttons are larger elements, and remain on screen after the user has clicked on them. Quick replies will display just above the user input and disappear once clicked. You can also fit more quick_reply
buttons (13) than regular buttons (3) per event.
To send quick_reply events, use the following syntax:
There are several types of quick_reply buttons. You can play with the type
and image_url
attributes. By default, quick_reply buttons are of type text
. The requirements/limitations defined in Facebook's documentation apply.
Carousel
Messenger provides a Carousel format which is quite interesting for some use cases. It allows for horizontal scrolling of one or several Cards, each having the ability to display an optional image and up to 3 buttons.
It is perfect as a menu for selecting what to do next!
Messenger's Carousel is a slightly specialized version of CSML's Carousel component: it has the same default parameters but additional options are available:
Raw objects
Some behaviors are currently unmatched with CSML components. The coverage for messenger templates will grow over time, however, please note that if you need to send a very specific template, you can always send the raw Messenger-formatted object.
For example, whilst CSML does not (yet) cover Airline Templates for Messenger, you can always send a raw Check-In Template object if you need it:
Broadcast
Messenger supports broadcasts, with some important caveats. You should read carefully what the limitations are on Facebook's documentation. In short:
You can send any message that you want to any user that previously sent a message to the bot in the last 24 hours
Messages must be sent exclusively to the app-scoped user ID (you can not send a broadcast using the user's email address for example)
After this 24-hours window, you must include one of the valid message tags in your request. This is done by adding a
"message_tag":"TAG_NAME"
in the metadata of the request, as shown below:
Failing to respect this rule may get your chatbot and/or page banned from facebook!
Limitations
In general, all Messenger limitations apply. For example, texts can not be larger than 2000 UTF-8 characters, and attachment sizes (Videos, Audio, Files) can not be larger than 25MB.
Regular buttons are limited to 3 per single event, while quick_reply buttons allow up to 13 buttons. The length of the button title should also never be longer than 20 characters.
Single Button Components
Messenger requires buttons to have an accompanying text. The following CSML code will display an error message in the conversation, as a Button
can not be used alone:
You should always use a Question
component instead:
Fallbacks
Files that are larger than 25MB will be sent as simple text instead of uploaded as attachments
Nice URLs are unavailable. They will display as simple text instead
Youtube/Dailymotion/Vimeo videos as well as Spotify/Deezer/Soundcloud audios will display as simple text
URL Buttons are currently unsupported natively (use raw objects for now)
Notifications
Due to the recent changes in the way Messenger handles sending notifications to your users, CSML Studio does not allow sending messages to users except for the regular use case of responding directly to a request the user made (by sending a text message, clicking a button, etc.). To send one-way notifications (or broadcasts) to your users, you need to build your own separate logic.
Event Metadata
A sample _metadata
for an incoming event will be similar to the following object:
Last updated