Notification samples
List of subscription trigger events:
- OUTBOUND_CALL_FINISHED
- OUTBOUND_TEXT_FINISHED
- INBOUND_CALL_FINISHED
- INBOUND_TEXT_FINISHED
- CAMPAIGN_STARTED
- CAMPAIGN_STOPPED
- CAMPAIGN_FINISHED
Notification format can be one of the following:
1. XML
2. JSON
3. EMAIL
When one of the events has happened Callfire sends HTTP POST request to endpoint specified in subscription. Request payload depends on event. You can find below several samples of request payload.
Outbound SMS
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<n:TextNotification xmlns="http://api.callfire.com/data" xmlns:n="http://api.callfire.com/notification/xsd">
<n:SubscriptionId>41001</n:SubscriptionId>
<Text id="11111111111">
<FromNumber>67076</FromNumber>
<ToNumber>11111111111</ToNumber>
<State>FINISHED</State>
<BatchId>11111111</BatchId>
<BroadcastId>111111111</BroadcastId>
<ContactId>11111111111</ContactId>
<Inbound>false</Inbound>
<Created>2013-03-11T20:09:58Z</Created>
<Modified>2013-03-11T20:10:07Z</Modified>
<FinalResult>SENT</FinalResult>
<TextRecord id="11111111111">
<Result>SENT</Result>
<FinishTime>2013-03-11T20:10:02Z</FinishTime>
<BilledAmount>0.03</BilledAmount>
<Message>Hello, CallFire!</Message>
</TextRecord>
</Text>
</n:TextNotification>
Inbound SMS
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<n:TextNotification xmlns="http://api.callfire.com/data" xmlns:n="http://api.callfire.com/notification/xsd">
<n:SubscriptionId>19001</n:SubscriptionId>
<Text id="5707328001">
<FromNumber>18185551212</FromNumber>
<ToNumber>18186469991</ToNumber>
<State>FINISHED</State>
<ContactId>1418291001</ContactId>
<Inbound>true</Inbound>
<Created>2012-09-24T05:02:35Z</Created>
<Modified>2012-09-24T05:02:35Z</Modified
<FinalResult>RECEIVED</FinalResult>
<Message>Hello, World!</Message>
<TextRecord id="3526268001">
<Result>RECEIVED</Result>
<FinishTime>2012-09-24T05:02:35Z</FinishTime>
<BilledAmount>0.03</BilledAmount>
<Message>Hello, World!</Message>
</TextRecord>
</Text>
</n:TextNotification>
Inbound SMS
{
"TextNotification": {
"SubscriptionId": 580989003,
"AccountId": 146076003,
"Text": {
"@id": "826451071003",
"FromNumber": 16505754427,
"ToNumber": 67076,
"State": "FINISHED",
"ContactId": 639094507003,
"Inbound": true,
"Created": "2016-04-08T14:30:07Z",
"Modified": "2016-04-08T14:30:07Z",
"FinalResult": "RECEIVED",
"Message": "KEYWORD msg",
"TextRecord": {
"@id": "457143299003",
"Result": "RECEIVED",
"FinishTime": "2016-04-08T14:30:07Z",
"BilledAmount": 1,
"Message": "KEYWORD msg"
}
}
}
}
Outbound SMS
{
"TextNotification": {
"SubscriptionId": 580989003,
"AccountId": 146076003,
"Text": {
"@id": "826451071003",
"FromNumber": 67076,
"ToNumber": 16505754427,
"State": "FINISHED",
"ContactId": 639094507003,
"Inbound": false,
"Created": "2016-04-08T14:30:07Z",
"Modified": "2016-04-08T14:30:07Z",
"FinalResult": "SENT",
"Message": "Hello Callfire",
"TextRecord": {
"@id": "457143299003",
"Result": "SENT",
"FinishTime": "2016-04-08T14:30:07Z",
"BilledAmount": 1,
"Message": "KEYWORD msg"
}
}
}
}
Outbound call
{
"CallFinished": {
"SubscriptionId": 610796003,
"AccountId": 146076003,
"Call": {
"@id": "974239899003",
"FromNumber": 12132212384,
"ToNumber": 12132212384,
"State": "FINISHED",
"BatchId": 10642974003,
"BroadcastId": 11865457003,
"ContactId": 740023230003,
"Inbound": false,
"Created": "2016-06-29T18:52:08Z",
"Modified": "2016-06-29T18:52:48Z",
"FinalResult": "LA",
"CallRecord": {
"@id": "540899478003",
"Result": "LA",
"FinishTime": "2016-06-29T18:52:48Z",
"BilledAmount": 1,
"OriginateTime": "2016-06-29T18:52:26Z",
"AnswerTime": "2016-06-29T18:52:31Z",
"Duration": 17
},
"AgentCall": false
}
}
}
Campaign started/stopped/finished
{
"BroadcastNotification": {
"SubscriptionId": 610798003,
"AccountId": 146076003,
"Broadcast": {
"@id": "11865457003",
"Name": "Send Call Java API Client",
"Status": "FINISHED",
"LastModified": "2016-06-29T18:57:51Z",
"Type": "VOICE",
"Label": [
"label2",
"test_label1"
],
"VoiceBroadcastConfig": {
"Created": "2016-06-24T11:03:18Z",
"FromNumber": 12132212384,
"RetryConfig": {
"MaxAttempts": 1,
"MinutesBetweenAttempts": 60,
"RetryResults": "",
"RetryPhoneTypes": "FIRST_NUMBER"
},
"AnsweringMachineConfig": "AM_AND_LIVE",
"LiveSoundId": 3192935003,
"MachineSoundId": 3192935003
}
}
}
}