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

This operation creates a Broadcast campaign and returns an id, there are 3 types of Broadcast: TEXT, IVR, or VOICE

Operation parameters

Depending on type of broadcast it has different BroadcastConfigs thus different input properties:

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

Use this operation to see the status of Broadcasts in account. Filter by type of campaign whether currently running.

Operation parameters

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

Return single broadcast by id

Operation parameters

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

Update existing broadcast's configuration such as time zone restrictions or retry logic.

Operation parameters

Depending on type of broadcast it has different BroadcastConfigs thus different input properties:

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

Apply command START, STOP, or ARCHIVE to Broadcast. Also can change the max active count of Broadcast.

Operation parameters

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

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

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

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

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

This operation provides the ability to update Name, enable or disable the list of contacts associated with a ContactBatch

Operation parameters

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