Broadcast
Broadcasts endpoint
API path: https://www.callfire.com/api/1.1/rest/broadcast
All api endpoints return response in XML format by default, to get response in JSON put .json at the end of API path.
Create broadcast
- Method: POST
- Request URI: /broadcast
This operation creates a Broadcast campaign and returns an id, there are 3 types of Broadcast: TEXT, IVR, or VOICE
Operation parameters
- Name - Name of broadcast
- Type - type of broadcast, possible values are:
- TEXT - text broadcast
- VOICE - voice broadcast
- IVR - IVR broadcast
Depending on type of broadcast it has different BroadcastConfigs thus different input properties:
TEXT:
- Label - Label for Broadcast
- From - E.164 11 digit number or short code
- LocalRestrictBegin - Earliest time a client can be contacted in the timezone associated with the number's NPA/NXX, format: HH:mm:ss
- LocalRestrictEnd - Latest time a client can be contacted in the timezone associated with the number's NPA/NXX, format: HH:mm:ss
- MaxAttempts - Max attempts to retry broadcast (default: 1)
- MinutesBetweenAttempts - Minutes between broadcast attempts (default: 60)
- RetryResults - Conditions to retry on
- RetryPhoneTypes - Phone types to call in retry
- Message - 160 char or less message to be sent in text broadcast. Use rented 'keyword' in message if need response
- BigMessageStrategy - Set strategy if message is over 160 chars (default: SEND_MULTIPLE), possible values:
- SEND_MULTIPLE - send as multiple texts
- DO_NOT_SEND - do not send in case of long text
- TRIM - trims to 160 chars
VOICE / IVR:
- Label - Label for Broadcast
- From - E.164 11 digit number or short code
- LocalRestrictBegin - Earliest time a client can be contacted in the timezone associated with the number's NPA/NXX, format: HH:mm:ss
- LocalRestrictEnd - Latest time a client can be contacted in the timezone associated with the number's NPA/NXX, format: HH:mm:ss
- MaxAttempts - Max attempts to retry broadcast (default: 1)
- MinutesBetweenAttempts - Minutes between broadcast attempts (default: 60)
- RetryResults - Conditions to retry on
- RetryPhoneTypes - Phone types to call in retry
- AnsweringMachineConfig - Action to take if machine answers
- LiveSoundText - Live answer TTS
- LiveSoundId - ID of Sound to play if call answered by live person
- LiveSoundTextVoice - TTS voice
- MachineSoundText - AM TTS
- MachineSoundId -ID of Sound to play if call answered by machine
- MachineSoundTextVoice - TTS voice
- TransferSoundText - transfer TTS
- TransferSoundId - ID of Sound to play if call transfered
- TransferSoundTextVoice - TTS voice
- TransferDigit - Phone digit call transfers on if pressed
- TransferNumber - Number to transfer call to
- DncSoundText - DNC TTS
- DncSoundId -Do Not Call unique ID of sound
- DncSoundTextVoice - TTS voice
- DncDigit - Do Not Call Digit
- MaxActiveTransfers - Max Transfers
Example how to create text broadcast
$ curl https://www.callfire.com/api/1.1/rest/broadcast.json \
-u login:password \
-X POST \
-d Name=Text Broadcast \
-d Type=TEXT \
-d From=67076 \
-d Message=Hello Callfire API
Example how to create voice broadcast
curl https://www.callfire.com/api/1.1/rest/broadcast.json \
-u login:password \
-X POST \
-d Name=Voice Broadcast \
-d Type=VOICE \
-d From=12132212384 \
-d RetryResults=BUSY \
-d RetryPhoneTypes=HOME_PHONE \
-d LocalRestrictBegin=10:00:00 \
-d LocalRestrictEnd=14:00:00 \
-d LiveSoundText=live text example \
-d LiveSoundTextVoice=MALE1 \
-d AnsweringMachineConfig=LIVE_WITH_AMD \
-d MachineSoundText=AM text \
-d MaxActiveTransfers=2 \
-d Label=label1 \
-d Label=label2
Example response
response code - 201 Created
{
"ResourceReference": {
"Id":609951003,
"Location":"https://www.callfire.com/api/1.1/rest/broadcast/609951003"
}
}
Query broadcasts
- Method: GET
- Request URI: /broadcast
Use this operation to see the status of Broadcasts in account. Filter by type of campaign whether currently running.
Operation parameters
- Type - broadcast type, possible values:
- VOICE
- IVR
- TEXT
- CCC
- Running - filter running broadcasts
- LabelName - filter by label
- FirstResult - Start of next result set (default: 0)
- MaxResults - Max number of results to return limited to 1000 (default: 1000)
Example request
$ curl https://www.callfire.com/api/1.1/rest/broadcast.json \
-u login:password \
-X GET \
-d Type=TEXT \
-d Running=false \
-d MaxResults=2
Example response
response code - 200 OK
{
"ResourceList":{
"@totalResults":18,
"Broadcast":[
{
"@id":6117119003,
"Name":"Text Broadcast, 7/3/15 3:26 PM",
"Status":"FINISHED",
"LastModified":"2015-07-03T12:29:01Z",
"Type":"TEXT",
"TextBroadcastConfig":{
"Created":"2015-07-03T12:26:02Z",
"FromNumber":"67076",
"Message":"Hello Callfire"
}
},
{
"@id":6164025003,
"Name":"API Send",
"Status":"FINISHED",
"LastModified":"2015-07-07T13:09:31Z",
"Type":"TEXT",
"TextBroadcastConfig":{
"Created":"2015-07-07T13:09:14Z",
"FromNumber":"67076",
"Message":"test message"
}
}
]
}
}
Get single broadcast
- Method: GET
- Request URI: /broadcast/{id}
Return single broadcast by id
Operation parameters
- Id - Unique ID of resource
Example request
$ curl https://www.callfire.com/api/1.1/rest/broadcast/6090706003.json \
-u login:password
Example response
response code - 200 OK
{
"Resource": {
"Broadcast": {
"@id": 14353440003,
"Name": "Voice",
"Status": "STOPPED",
"LastModified": "2016-09-12T13:04:24Z",
"Type": "VOICE",
"Label": [
"label1",
"label2"
],
"VoiceBroadcastConfig": {
"Created": "2016-09-12T13:04:24Z",
"FromNumber": "12132212384",
"LocalTimeZoneRestriction": {
"BeginTime": "10:00:00Z",
"EndTime": "14:00:00Z"
},
"RetryConfig": {
"MaxAttempts": 1,
"MinutesBetweenAttempts": 60,
"RetryResults": "BUSY",
"RetryPhoneTypes": "HOME_PHONE"
},
"AnsweringMachineConfig": "LIVE_WITH_AMD",
"LiveSoundId": 3654482003,
"MachineSoundId": 3654483003,
"MaxActiveTransfers": 2
}
}
}
}
Update broadcast
- Method: PUT
- Request URI: /broadcast/{id}
Update existing broadcast's configuration such as time zone restrictions or retry logic.
Operation parameters
- Id - Unique ID of resource
- Name - Name of broadcast
- Type - type of broadcast, possible values are:
- TEXT - text broadcast
- VOICE - voice broadcast
- IVR - IVR broadcast
Depending on type of broadcast it has different BroadcastConfigs thus different input properties:
TEXT:
- Label - Label for Broadcast
- From - E.164 11 digit number or short code
- LocalRestrictBegin - Earliest time a client can be contacted in the timezone associated with the number's NPA/NXX, format: HH:mm:ss
- LocalRestrictEnd - Latest time a client can be contacted in the timezone associated with the number's NPA/NXX, format: HH:mm:ss
- MaxAttempts - Max attempts to retry broadcast (default: 1)
- MinutesBetweenAttempts - Minutes between broadcast attempts (default: 60)
- RetryResults - Conditions to retry on
- RetryPhoneTypes - Phone types to call in retry
- Message - 160 char or less message to be sent in text broadcast. Use rented 'keyword' in message if need response
- BigMessageStrategy - Set strategy if message is over 160 chars (default: SEND_MULTIPLE), possible values:
- SEND_MULTIPLE - send as multiple texts
- DO_NOT_SEND - do not send in case of long text
- TRIM - trims to 160 chars
VOICE / IVR:
- Label - Label for Broadcast
- From - E.164 11 digit number or short code
- LocalRestrictBegin - Earliest time a client can be contacted in the timezone associated with the number's NPA/NXX, format: HH:mm:ss
- LocalRestrictEnd - Latest time a client can be contacted in the timezone associated with the number's NPA/NXX, format: HH:mm:ss
- MaxAttempts - Max attempts to retry broadcast (default: 1)
- MinutesBetweenAttempts - Minutes between broadcast attempts (default: 60)
- RetryResults - Conditions to retry on
- RetryPhoneTypes - Phone types to call in retry
- AnsweringMachineConfig - Action to take if machine answers
- LiveSoundText - Live answer TTS
- LiveSoundId - ID of Sound to play if call answered by live person
- LiveSoundTextVoice - TTS voice
- MachineSoundText - AM TTS
- MachineSoundId -ID of Sound to play if call answered by machine
- MachineSoundTextVoice - TTS voice
- TransferSoundText - transfer TTS
- TransferSoundId - ID of Sound to play if call transfered
- TransferSoundTextVoice - TTS voice
- TransferDigit - Phone digit call transfers on if pressed
- TransferNumber - Number to transfer call to
- DncSoundText - DNC TTS
- DncSoundId -Do Not Call unique ID of sound
- DncSoundTextVoice - TTS voice
- DncDigit - Do Not Call Digit
- MaxActiveTransfers - Max Transfers
Example request
$ curl https://www.callfire.com/api/1.1/rest/broadcast/14353440003.json \
-u login:password \
-X PUT \
-d Name=updated \
-d Type=VOICE \
-d From=12132212384 \
-d RetryResults=BUSY \
-d RetryPhoneTypes=WORK_PHONE \
-d Label=label5
Example response
response code - 204 No content
Broadcast control
- Method: PUT
- Request URI: /broadcast/{id}/control
Apply command START, STOP, or ARCHIVE to Broadcast. Also can change the max active count of Broadcast.
Operation parameters
- Id - Unique ID of resource
- Command - control command, possible values:
- START
- STOP
- ARCHIVE
- MaxActive - Max simultaneous calls
Example request
$ curl https://www.callfire.com/api/1.1/rest/broadcast/6090706003/control.json \
-u login:password \
-X PUT \
-d Command=START \
-d MaxActive=100
Example response
response code - 204 No content
Create contact batch
- Method: POST
- Request URI: /broadcast/{id}/batch
Contact Batch is a list of contacts to associate with a broadcast. Use this operation to attach a list of contacts to an existing Campaign. A list of ToNumbers or an existing Contact List ID is required to create and attach the Contact List. Returned is the unique contactListId that can be used in ControlContactBatch to enable or disable this batch.
Operation parameters
- Id - broadcast ID
- Name - batch name
- To - comma separated list of phone numbers
- ContactListId - contact list id
- ScrubBroadcastDuplicates - scrub contact duplicates
- Start - if true start broadcast immediately
Note: contact list id or phone numbers are required
Example request
$ curl https://www.callfire.com/api/1.1/rest/broadcast/6090706003/batch.json \
-u login:password \
-X POST \
-d Name=contact batch \
-d ContactListId=2112041003 \
-d ScrubBroadcastDuplicates=true
Example response
response code - 201 Created
{
"ResourceReference":{
"Id":10637090003,
"Location":"https://www.callfire.com/api/1.1/rest/broadcast/batch/10637090003"
}
}
Get all broadcast batches
- Method: GET
- Request URI: /broadcast/{id}/batch
Return list of Contact Batches associated with this Broadcast. The contactBatchIds returned from this campaign can then be used to enable, disable, or delete the individual Batches
Operation parameters
- Id - Unique ID of resource
- FirstResult - Start of next result set (default: 0)
- MaxResults - Max number of results to return limited to 1000 (default: 1000)
Example request
$ curl https://www.callfire.com/api/1.1/rest/broadcast/6090706003/batch.json \
-u login:password
Example response
response code - 200 OK
{
"ResourceList":{
"@totalResults":1,
"ContactBatch":[
{
"@id":10592411003,
"Name":"updated batch",
"Status":"ACTIVE",
"BroadcastId":12511506003,
"Created":"2016-06-27T21:45:20Z",
"Size":2,
"Remaining":2
}
]
}
}
Broadcast batch control
- Method: PUT
- Request URI: /broadcast/batch/{id}/control
This operation provides the ability to update Name, enable or disable the list of contacts associated with a ContactBatch
Operation parameters
- Id - batch ID
- Name - batch name
- Enabled - enable/disable batch
Example request
$ curl https://www.callfire.com/api/1.1/rest/broadcast/6090706003/batch.json \
-u login:password \
-X PUT \
-d Name=new name \
-d Enabled=false
Example response
response code - 204 No content