-
-
Notifications
You must be signed in to change notification settings - Fork 193
Broadcast node
The Broadcast node
allows sending a message to all users that have an open conversation with the chatbot.
Only few message types are allowed: message
, generic-template
, list-template
and inline-buttons
.
A message must be stored before it can be broadcasted
In this example a simple to broadcast a text message: the Broadcast node
store the message and returns a broadcast
type message that will actually sent by the Facebook Sender node
.
A Conversation node is required in order at the beginning of the flow (in that case the chatId is left blank).
In the text messages tokens can be used
Hello {{first_name}} {{last_name}}!
that will be replaced by the recipient's first name and last name.
If the Facebook sender
has the the pass-thru option enabled, the resulting message will the broadcastId which can be used to fetch the status and the metrics of the broadcasted message.
{
// ...
payload: {
broadcastId: '123456'
}
};
A broadcast
message (which is basically a message stored on Facebook Messenger server ready to be sent) can also be scheduled
Given the broadcastId it's also possible to cancel or get the status of a scheduled message.
Available parameters for the msg.payload
Name | Type | Description |
---|---|---|
command | string | The method of the Broadcast API to execute. Could be: store, schedule, metrics, list, cancel, status |
broadcastId | string | The id of a broadcasted (or scheduled message) |
messageId | string | The id of a stored message, ready to be broadcasted |
messagingType | string | Type of notification for the message. Could be: REGULAR, SILENT_PUSH, NO_PUSH |
sendAt | string | ISO-8601 date format of the schedule date and time ('1970-01-02T00:00:00+0000') |