Call
Calls endpoint
API path: https://www.callfire.com/api/1.1/rest/call
All api endpoints return response in XML format by default, to get response in JSON put .json at the end of API path.
Send a call
- Method: POST
- Request URI: /call
Start sending calls using VoiceBroadcastConfig or by setting up an IVR using IvrBroadcastConfig. Sending a call requires at least a ToNumber and sound id or an IVR. The returned broadcastId can be passed to QueryCalls to get state of call actions in campaign and get list of individual callIds for use in GetCall request.
Operation parameters
- Type - Type of Broadcast, must be set to VOICE or IVR
- BroadcastName - Title of Broadcast (default: API Send)
- To - List of E.164 11 digit numbers space or comma separated
- ScrubBroadcastDuplicates - Scrub duplicates (default: false)
- 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
Note: SoundText or SoundId is required
Example request
$ curl https://www.callfire.com/api/1.1/rest/call.json \
-X POST \
-u login:password \
-d Type=VOICE \
-d BroadcastName=Api broadcast \
-d To=12132212384,12132212384 \
-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 calls
- Method: GET
- Request URI: /call
Query for calls using standard ActionQuery which filters on batchId, broadcastId, toNumber, etc.
Operation parameters
- FirstResult - Start of next result set (default: 0)
- MaxResults - Max number of results to return limited to 1000 (default: 1000)
- BroadcastId - filter by broadcastId
- BatchId - filter by batchId
- State - filter by text internal state, available values (see detail description at call states and results):
- READY
- SELECTED
- CALLBACK
- DISABLED
- SKIPPED
- FINISHED
- DNC
- DUP
- INVALID
- TIMEOUT
- PERIOD_LIMIT
- Result - text result, possible values:
- LA - Live answer
- AM - Answering machine
- BUSY - number is busy
- DNC - number is in DNC list
- XFER - transferred call
- NO_ANS - no answer
- UNDIALED - number is undialed
- INTERNAL_ERROR - Callfire internal error
- CARRIER_ERROR - error has occurred on upstream carrier
- Inbound - filter inbound texts
- IntervalBegin - beginning of DateTime interval to search on, format: "yyyy-MM-dd'T'HH:mm:ssXXX"
- IntervalEnd - end of DateTime interval to search on, format: "yyyy-MM-dd'T'HH:mm:ssXXX"
- FromNumber - filter by from number
- ToNumber - filter by to number
- LabelName - filter by label
Example request
$ curl https://www.callfire.com/api/1.1/rest/call.json \
-u login:password \
-X GET \
-d MaxResults=2 \
-d BroadcastId=6117655003 \
-d Result=LA \
-d IntervalBegin=2016-02-01'T'23:00:00 \
-d IntervalEnd=2016-03-01'T'23:00:00
Example response
response code - 200 OK
{
"ResourceList": {
"@totalResults": 1,
"Call": [
{
"@id": 961660416003,
"FromNumber": "12132555384",
"ToNumber": {
"value": "12132212384"
},
"State": "FINISHED",
"BatchId": 10519301003,
"BroadcastId": 11865457003,
"ContactId": 733653129003,
"Inbound": false,
"Created": "2016-06-24T11:08:55Z",
"Modified": "2016-06-24T11:10:08Z",
"FinalResult": "LA",
"CallRecord": [
{
"@id": 534795672003,
"Result": "LA",
"FinishTime": "2016-06-24T11:10:08Z",
"BilledAmount": 1.0,
"SwitchId": "bf915058-9394-4001-a53b-ca2266c4aad2",
"OriginateTime": "2016-06-24T11:09:33Z",
"AnswerTime": "2016-06-24T11:09:58Z",
"Duration": 10
}
],
"AgentCall": false
}
]
}
}
Get single call
- Method: GET
- Request URI: /call/{id}
Return individual call action. See QueryCalls to return a list of call actions and determine individual callIds.
Operation parameters
- Id - Unique ID of resource
Example request
$ curl https://www.callfire.com/api/1.1/rest/call/6090706003.json \
-u login:password
Example response
response code - 200 OK
{
"Resource": {
"Call": {
"@id": 959189031003,
"FromNumber": "12677745100",
"ToNumber": {
"value": "17172224889"
},
"State": "FINISHED",
"BatchId": 10478715003,
"BroadcastId": 12400358003,
"ContactId": 659475129003,
"Inbound": false,
"Created": "2016-06-22T18:31:28Z",
"Modified": "2016-06-22T18:31:49Z",
"FinalResult": "LA",
"CallRecord": [
{
"@id": 532611322003,
"Result": "LA",
"FinishTime": "2016-06-22T18:31:49Z",
"BilledAmount": 0.015,
"SwitchId": "0a697e29-e2ad-4055-b11c-9f39abb96d10",
"OriginateTime": "2016-06-22T18:31:30Z",
"AnswerTime": "2016-06-22T18:31:44Z",
"Duration": 5
}
],
"AgentCall": false
}
}
}