To send a message to your users, you will need to create a broadcast. A broadcast can refer to either a SMS message or a push notification and is delivered to subscribers within your mobile contact book.
The following are the three main sections to a broadcast:
- The metadata information, which includes the fields about the broadcast, such as the ID, URL, created date, and so on
- The targeting information, which includes the fields used to identify recipients and craft the message
- The delivery information, which is the metadata about the actual message delivery
Available API Methods
Elements & Attributes
Data Element | Type | Description |
---|---|---|
broadcast_id | Integer | Vibes unique identifier for each broadcast. |
status | String | The status of the broadcast. Examples (always lowercase): - scheduled : The broadcast will be sent at a scheduled time.- in_progress : The broadcast is being sent.- sent : The broadcast has finished sending.- canceled : The broadcast has been canceled.- deleted : The broadcast was canceled before sending.- paused : The broadcast is waiting for an external action.- failed : The broadcast has failed. |
url | String | Unique resource URL for the acquisition campaign. |
name | String | The descriptive name of the broadcast message. Example: "First alert message". |
created_by | String | The email address of the person who created the broadcast. |
created_by_application | String | The application. Example: null, api. |
send_scheduled_date | Timestamp | The date and time the broadcast is scheduled to be sent. It should be in the ISO 8601 format - for example: 2017-02-16T17:30:00Z. |
send_schedule | Object | Optional. Include this object if you would like to schedule the message to be sent by time zone. To use this feature, you should have previously collected time zone in a custom field stored in the person record. |
send_schedule.method | String | If you are scheduling the broadcast to be sent by time zone, set this to by_time_zone . Default method is by_date . |
send_schedule.field_name | String | If you are sending the broadcast by time zone, use this field to indicate the name of the custom field used to collect users’ time zones. |
send_schedule.send_date | String | The date you’d like the broadcast to be sent. Use yyyy-mm-dd format. |
send_schedule.send_time | String | The time you’d like the broadcast to be sent in the person’s indicated time zone. Use a 24-hour clock and the following format: HH:MM. Example: 17:30 |
send_schedule.default_time_zone | String | If you are sending the broadcast by time zone, this is the time zone that will be used if the person’s time zone is not indicated in a custom field. |
targeting | Object | The targeting information for the broadcast. Examples: message_template , channel , short_url_base , source_short_code , source_lists , shorten_urls . |
targeting.message_template | String | The text for the SMS or push message, including any custom fields or incentive tags. |
targeting.source_short_code | Object | Object containing short code acting as the sender of the broadcast (if SMS or MMS). |
targeting.source_short_code.short_code | String | Short code acting as the sender of the broadcast (if SMS or MMS). |
targeting.source_short_code.country_code | String | Country code for sender. Example: +1 |
targeting.source_short_code.source_type | String | "SC" for short or long numeric codes; "ANC" for alphanumeric codes. |
targeting.source_lists | Array | IDs of lists included in the broadcast. |
targeting.short_url_base | String | The base URL for all shortened URLs |
targeting.shorten_urls | Boolean | Indicates whether or not the system should auto-shorten URLs in your message. |
channel | String | SMS or Push |
delivery | Timestamp, String | The information about the broadcast delivery, including recipient_count, send_start_date, and enqueue_completed_date. |
created_at | Timestamp | The date this broadcast was created. It should be in the ISO 8601 format - for example: 2017-04-04T16:06:10Z. |
updated_at | Timestamp | The date this broadcast was last updated. It should be in the ISO 8601 format - for example: 2019-05-12T05:09:48Z. |
Entity Examples
The following is the JSON representation of an SMS Broadcast entity within the APIs.
{
"broadcast_id": "1",
"status": "sent",
"name": "First alert message",
"send_scheduled_date": "2017-04-04T16:05:00Z",
"created_by":"[email protected]",
"created_by_application": null,
"targeting": {
"message_template": "This is the 1st message sent to the {{ list_name }} list!",
"short_url_base":"http://vbs.cm/",
"shorten_urls": true,
"channel": "sms",
"source_short_code": null,
"source_lists": [
"A34H2q"
],
"filters": []
},
"delivery": {
"send_start_date": "2017-04-04T16:06:16Z",
"enqueue_completed_date": "2017-04-04T16:06:16Z",
"recipient_count": 1
},
"url": "/companies/:company_key/mobiledb/broadcasts/:broadcast_id",
"created_at": "2017-04-04T16:06:10Z",
"updated_at": "2019-05-12T05:09:48Z"
}
The following is the JSON representation of a Push Broadcast entity within the APIs.
{
"broadcast_id": "2",
"status": "scheduled",
"url": "/api/companies/:company_key/broadcasts/:broadcast_id",
"name": "Test Broadcast SAT 2",
"created_by": "[email protected]",
"created_by_application": "api",
"send_scheduled_date": "2017-02-16T17:30:00Z",
"send_schedule": {
"method": "by_time_zone",
"field_name": "vibes_timezone",
"send_date": "2017-02-16",
"send_time": "17:30",
"default_time_zone": "US/Central"
},
"targeting": {
"message_template": "Push message content",
"shorten_urls": true,
"short_url_base": "http://vbs.cm/",
"source_short_code": "54321",
"source_lists": [
"AB1234Z4",
"LIST12345"
],
"channel": "push",
"push": {
"subject": "Push message title",
"metadata": "App deep link"
},
"filters": [
{
"name": "favorite_sport",
"selector": "any",
"value": [
"football",
"baseball"
]
},
{
"name": "first_name",
"selector": "starts_with",
"value": "Steve"
},
{
"name": "recipient_list",
"selector": "any",
"value": [
"1"
]
},
{
"name": "participant_list",
"selector": "any",
"value": [
"1"
]
},
{
"name": "country",
"selector": "equals",
"value": "US"
},
{
"name": "subscription_date",
"transform": "year",
"selector": "before",
"value": [
"2017"
]
},
{
"name": "birthdate",
"transform": "year",
"selector": "before",
"value": [
"2017"
]
}
]
}
}