Broadcast

Broadcast

1. Introduction

Broadcast constitutes the ability to push content to your engaged chatbot users. This makes it a great marketing tool for business owners and marketers. The opportunities are immense and they can really help you

– Keep your users engaged on a regular basis
– Reach out to a specific segment of users for important notifications or transactions

2. Availability Platforms & Channels

MyBOT provides Broadcast Support for a good range of Chatbot Channels including –
Facebook Messenger
Whatsapp
Slack
Line
Website (& Mobile SDK) – Messages delivered if Chatbot is active during the broadcast

3. Creating a Broadcast

MyBOT makes it super easy for you to create a Broadcast. Simply go to the Broadcast workflow which is accessible from the left Navigation as Broadcast.

Once in the Broadcast Section, you would be able to view earlier created Broadcasts, that may be in Draft, Scheduled or Published State. You will also have the option to create a new Broadcast.

While creating a new Broadcast, besides opting for specific target channels, you can also –
– Select Broadcast Type
– Select User Segments
– Select Schedule

3.1 Broadcast Type

MyBOT provides you a mechanism to trigger a few different types of broadcasts. These include –

3.1.1  Send a Message:

This type of broadcast is non-interactive. The receiver will see a Message

3.1.2 Send Message with options:

This type of broadcast allows the sender to receive input from the receiver

3.1.3  Path:

This option takes the receiver through all the flows defined in a path.

While creating a new Broadcast, think of it as a way of re-engaging your users and get them to start interacting with your chatbot again. This means that avoid triggering paths to just deliver a lot of content to users.

3.2 User Segments

Target Segment option, while creating a new Broadcast, allows you to target your message to specific segments of users. Segments are used to categorise users based on certain rules which would be primarily comprised of attribute value combinations, including certain system ones. As an example, it could mean all users that provided their email addresses or all users that selected an option to be subscribed to promotional material.
Segments capability is available under Users > Actions> Manage Segments

In segments page we can see already created segments and we can add new segment by clicking on ADD SEGMENT. This would bring up the modal box UI that allows you to define a new Segment complete with the desired rule sets.

As an example, let us consider a scenario where you want to create a user segment, Millennials, for users that lie in the age bracket of 22-37. In this case, we would define Conditions for

-Age greater than 22
-Age lesser than or equal to 37
And define a filter expression A1 AND A2.
To define a more complex filter expression consisting of multiple conditions and involving a mix of AND/OR operands, select CUSTOM as the filter expression and this would then allow you to define an expression using the defined conditions.

Note : –

Facebook messenger is not available in the target channels, to send broadcast messages on Messenger you would need to have permissions to send non-promotional content via that page. Once your page has this permission you will be able to see messenger active in the target channels for broadcast. You can request this permission from the Page settings -> Advanced messaging -> Request features, there you would see subscription messaging and you can request for it. I have attached a few screenshots for the same.

3.3 Select Schedule

As the title suggests, this option allows you to define a set schedule for when you want the broadcast to be initiated/published. You could publish a broadcast as a one time or recurring occurrence. If recurring you can opt to select the frequency and the time period during which the broadcast will continue to be active.

4. Broadcast APIs

4.1 Basic Usage

Broadcast Message Using API(s) can be sent using the below API Details –

  • URL:
  •  HTTP Method: POST
  • Headers:
    – Content-Type: application/json
    – Authorization: Basic <Auth token> (generated from Integrations > Developer Settings)
  • Segmentation of users can be done using either one of the following attributes:
    – LastActiveAfter: “lastActiveAfter”: “2019-03-20T12:49:15.374Z”
    – Channeluserids: “channelUserIds”:[“918951139300”,”7e84cfe1-5b64-45f8-9d3d-bc158e5d8d31″]
    – Userids: “userIds”: [“7e84cfe1-5b64-45f8-9d3d-bc158e5d8d31″, 3d84gfe1-5b64-45f8-9d3d-bc158e5d234″]
    – Channels: “Channels”:[“whatsapp”,”web”]

See below an example for defining Rules for User Segmentation using above Attributes
“attributeRule”: {
“attributes”: [{
“name”: “user_category”,
“value”: “corporate”
},
{
“name”: “attributeName2”,
“value”: “attributeVal2”
},
{
“name”: “attributeName3”,
“value”: “attributeValue3”
}],
“expression”: “((1 AND 2) OR 3)”
}

4.2 Usage Rules

While defining the Broadcast Segment using an API, the below rules have to be kept in mind –
Specifying Channels is mandatory
Channeluserids are user ids provided by the platform
Userids are system generated user ids
If we are sending a DIRECT message on whatsApp , LastActiveAfter is 24hrs.
For web LastActiveAfter is 48hrs.

4.3 Direct Message

See an example below of a Broadcast API request for a Direct Message to be sent to users
{
“broadcastId”: null,
“broadcastTitle”: “testing broadcast”,
“publishedOn”: “2019-06-03T06:48:27.170Z”,
“audience”: {
“rule”: {
“channels”:[“whatsapp”],
“channelUserIds”:[“918951139300”]
}
},
“payload”: {
“type”: “DIRECT”,
“content”: [
{
“type”: “TEXT”,
“data”: {
“message”: “This is a test message”
}
},
{
“type”: “TEXT”,
“data”: {
“message”: “This is another message”
}
}
]
},
“status”: null
}
Direct Message with Options
See an example below of a Broadcast API request for a Message with options sent to users
{
“broadcastId”: null,
“broadcastTitle”: “testing broadcast”,
“publishedOn”: “2019-06-03T06:48:27.170Z”,
“audience”: {
“rule”: {
“userIds”: [],
“channelUserIds”:[“7e84cfe1-5b64-45f8-9d3d-bc158e5d8d31”],
“channels”:[“web”]
}
},
“payload”: {
“type”: “FLOW”,
“content”: [{
“type”: “OPTIONS”,
“data”: {
“message”: “Please select a option”,
“options”: [{
“text”: “Option 1”,
“postback”: “flow_ECD6F99C0FF4427C812543994BDFC213”
},
{
“text”: “Option 2”,
“postback”: “flow_livechat_trigger_5029”
}
]

}
}]
},
“status”: null
}

4.4  Set an attribute and send a message (optional)

See an example below of a Broadcast API request to set an attribute and send a message

{
“broadcastId”: null,
“broadcastTitle”: “testing broadcast”,
“publishedOn”: “2019-06-03T06:48:27.170Z”,
“audience”: {
“rule”: {
“channels”:[“whatsapp”],
“channelUserIds”:[“918951139300”]
}
},
“payload”: {
“type”: “FLOW”,
“content”: [{
“type”: “TEXT”,
data”: {
“message”: “score:100”
},
“attributes”: [{
“name”: “attribute name 1”,
“value”: “attribute Value 1”
},
{
“name”: “attribute name 2”,
“value”: “attribute Value 2”
}
]
}
]
},

“status”: null
}

4.5 Trigger a Path and send a message (optional)

See an example below of a Broadcast API request to trigger a path and send a message

{

“broadcastId”: null,
“broadcastTitle”: “testing broadcast”,
“publishedOn”: “2019-06-03T06:48:27.170Z”,
“audience”: {
“rule”: {
“userIds”: [],
“channelUserIds”:[“7e84cfe1-5b64-45f8-9d3d-bc158e5d8d31”],
“channels”:[“web”]
}
},
“payload”: {
“type”: “FLOW”,
“content”: [{
“type”: “TEXT”,
“flowKey”: “C5019AA6D10D433DA0EE50EF61E69F02”,
“data”: {
“message”: “score:100”
}
}]
},
“status”: null
}

4.6 Template Message on Whatsapp

Whatsapp typically supports in session messages that are messages, sent to a user who was active with the chatbot in the last 24 hours. For initiating a conversation or notification beyond that time window, you need to send what’s called a message with defined template.
MyBOT supports sending template messages for Whatsapp using the below API structure.

{
“broadcastId”: null,
“broadcastTitle”: “test_broadcast1312”,
“publishedOn”: “2019-06-03T06:48:27.170Z”,
“audience”: {
“rule”: {
“userIds”: [],
“channelUserIds”:[“918951139300″,”919150238942”],
“channels”:[“whatsapp”]
}
},
“payload”: {
“type”: “WHATSAPP_TEMPLATE”,
“content”: [
{
“type”: “TEMPLATE”,
“template”:{
“name”:”whatsapp:hsm:technology:nexmo:verify”,
“parameters”:[
{
“default”:”Nexmo Verification”
},
{
“default”:”64873″
},
{
“default”:”10″
}
]
}
}
]
},
“status”: null
}

Was this article helpful?

Related Articles

Leave A Comment?