This endpoint allows you to send new message broadcasts and list existing broadcasts in your account.
Listing Broadcasts
A GET
returns the outgoing message activity for your organization, listing the most recent messages first.
- id - the id of the broadcast (int), filterable as
id
. - urns - the URNs that received the broadcast (array of strings).
- contacts - the contacts that received the broadcast (array of objects).
- groups - the groups that received the broadcast (array of objects).
- text - the message text translations (dict of strings).
- attachments - the attachment translations (dict of lists of strings).
- base_language - the default translation language (string).
- status - the status, one of
pending
,queued
,started
,completed
,failed
,interrupted
. - created_on - when this broadcast was either created (datetime) (filterable as
before
andafter
).
Example:
GET /api/v2/broadcasts.json
Response is a list of recent broadcasts:
{
"next": null,
"previous": null,
"results": [
{
"id": 123456,
"urns": ["tel:+250788123123", "tel:+250788123124"],
"contacts": [{"uuid": "09d23a05-47fe-11e4-bfe9-b8f6b119e9ab", "name": "Joe"}]
"groups": [],
"text": {"eng", "hello world"},
"attachments": {"eng", []},
"base_language": "eng",
"created_on": "2013-03-02T17:28:12.123456Z"
},
...
Sending Broadcasts
A POST
allows you to create and send new broadcasts. Attachments are media object UUIDs returned from POSTing
to the media endpoint.
- urns - the URNs of contacts to send to (array of up to 100 strings, optional)
- contacts - the UUIDs of contacts to send to (array of up to 100 strings, optional)
- groups - the UUIDs of contact groups to send to (array of up to 100 strings, optional)
- text - the message text translations (dict of strings)
- attachments - the attachment translations (dict of lists of strings)
- base_language - the default translation language (string, optional)
Example:
POST /api/v2/broadcasts.json
{
"urns": ["tel:+250788123123", "tel:+250788123124"],
"contacts": ["09d23a05-47fe-11e4-bfe9-b8f6b119e9ab"],
"text": {"eng": "Hello @contact.name!", "spa": "Hola @contact.name!"},
"base_language": "eng"
}
You will receive a response containing the message broadcast created:
{
"id": 1234,
"urns": ["tel:+250788123123", "tel:+250788123124"],
"contacts": [{"uuid": "09d23a05-47fe-11e4-bfe9-b8f6b119e9ab", "name": "Joe"}]
"groups": [],
"text": {"eng": "Hello @contact.name!", "spa": "Hola @contact.name!"},
"attachments": {"eng", [], "spa": []},
"base_language": "eng",
"created_on": "2013-03-02T17:28:12.123456Z"
}