CallFire Solutions

Webhook samples

Follow

List of webhooks trigger events:

  1. CCC_CAMPAIGN(STARTED, STOPPED, FINISHED)
  2. CALL_BROADCAST(STARTED, STOPPED, FINISHED)
  3. TEXT_BROADCAST(STARTED, STOPPED, FINISHED)
  4. OUTBOUND_CALL(FINISHED)
  5. INBOUND_CALL(FINISHED)
  6. OUTBOUND_TEXT(FINISHED)
  7. INTBOUND_TEXT(FINISHED)
  8. MONTHLY_RENEWAL(FINISHED, FAILED)
  9. LOW_BALANCE(FINISHED, FAILED) 

Notification format: JSON

When one of the events has happened Callfire sends HTTP POST request to endpoint specified in webhook. Request payload depends on event. You can find below several samples of request payload.

 

CallBroadcast
{
   "timestamp":1469538171888,
   "webhookId":3745003,
   "webhookName":"Test Webhook",
   "resourceType":"CallBroadcast",
   "events":[
      {
         "timestamp":1469538171888,
         "webhookId":3745003,
         "resourceType":"CallBroadcast",
         "eventType":"Stopped",
         "resource":{
            "id":13175997003,
            "name":"Test Webhook",
            "status":"STOPPED",
            "lastModified":1469538170000,
            "fromNumber":"12132212384",
            "localTimeRestriction":{
               "enabled":true,
               "beginHour":8,
               "beginMinute":0,
               "endHour":21,
               "endMinute":0
            },
            "schedules":[
               {
                  "id":1617524003,
                  "startDate":{
                     "year":2016,
                     "month":7,
                     "day":28
                  },
                  "startTimeOfDay":{
                     "hour":9,
                     "minute":0,
                     "second":0
                  },
                  "stopTimeOfDay":{
                     "hour":17,
                     "minute":0,
                     "second":0
                  },
                  "timeZone":"America/Los_Angeles",
                  "daysOfWeek":[
                     "MONDAY"
                  ]
               }
            ],
            "retryConfig":{
               "maxAttempts":1,
               "minutesBetweenAttempts":60,
               "retryResults":[

               ],
               "retryPhoneTypes":[
                  "FIRST_NUMBER"
               ]
            },
            "maxActive":100,
            "labels":[
               "Label1"
            ],
            "resumeNextDay":false,
            "recipients":[
               {
                  "contactId":1232412334
               }
            ],
            "sounds":{
               "liveSoundText":"Test",
               "liveSoundId":3363224003,
               "machineSoundText":"Test",
               "machineSoundId":3363224003,
               "transferSoundText":"Test",
               "transferSoundId":3363224003
            },
            "answeringMachineConfig":"LIVE_WITH_AMD",
            "maxActiveTransfers":1
         }
      }
   ]
}


TextBroadcast
{
   "timestamp":1469538745454,
   "webhookId":3747003,
   "webhookName":"Test Webhook",
   "resourceType":"TextBroadcast",
   "events":[
      {
         "timestamp":1469538745454,
         "webhookId":3747003,
         "resourceType":"TextBroadcast",
         "eventType":"Started",
         "resource":{
            "id":13163667003,
            "name":"TEST Text Broadcast",
            "status":"RUNNING",
            "lastModified":1469538744000,
            "fromNumber":"12132041238",
            "localTimeRestriction":{
               "enabled":true,
               "beginHour":8,
               "beginMinute":0,
               "endHour":21,
               "endMinute":0
            },
            "schedules":[
               {
                  "id":1617524003,
                  "startDate":{
                     "year":2016,
                     "month":7,
                     "day":28
                  },
                  "startTimeOfDay":{
                     "hour":9,
                     "minute":0,
                     "second":0
                  },
                  "stopTimeOfDay":{
                     "hour":17,
                     "minute":0,
                     "second":0
                  },
                  "timeZone":"America/Los_Angeles",
                  "daysOfWeek":[
                     "MONDAY"
                  ]
               }
            ],
            "retryConfig":{
               "maxAttempts":1,
               "minutesBetweenAttempts":60,
               "retryResults":[

               ],
               "retryPhoneTypes":[
                  "FIRST_NUMBER"
               ]
            },
            "maxActive":100,
            "labels":[
               "Label1"
            ],
            "resumeNextDay":false,
            "recipients":[
               {
                  "message":"Test Message",
                  "contactId":1232412334
               }
            ],
            "message":"Test Message",
            "bigMessageStrategy":"SEND_MULTIPLE",
            "media":[
            ]
         }
      }
   ]
}


CccCampaign
{
   "timestamp":1469538171888,
   "webhookId":3745003,
   "webhookName":"Test Webhook",
   "resourceType":"CccCampaign",
   "events":[
      {
         "timestamp":1469538171888,
         "webhookId":3745003,
         "resourceType":"CccCampaign",
         "eventType":"Stopped",
         "resource":{
            "id":13175997004,
            "name":"Test Webhook",
            "status":"STOPPED",
            "lastModified":1469538170000,
            "fromNumber":"12132212384",
            "localTimeRestriction":{
               "enabled":true,
               "beginHour":8,
               "beginMinute":0,
               "endHour":21,
               "endMinute":0
            },
            "schedules":[
               {
                  "id":1617524003,
                  "startDate":{
                     "year":2016,
                     "month":7,
                     "day":28
                  },
                  "startTimeOfDay":{
                     "hour":9,
                     "minute":0,
                     "second":0
                  },
                  "stopTimeOfDay":{
                     "hour":17,
                     "minute":0,
                     "second":0
                  },
                  "timeZone":"America/Los_Angeles",
                  "daysOfWeek":[
                     "MONDAY"
                  ]
               }
            ],
            "retryConfig":{
               "maxAttempts":1,
               "minutesBetweenAttempts":60,
               "retryResults":[

               ],
               "retryPhoneTypes":[
                  "FIRST_NUMBER"
               ]
            },
            "maxActive":100,
            "labels":[
               "Label1"
            ],
            "resumeNextDay":false,
            "smartDropSoundId":23443872362,
            "recorded":true,
            "allowAnyTransfer":false,
            "multilineDialingEnabled":false,
            "allowSkipCall":false,
            "previewDialing":true,
            "scrubLevel":2,
            "agents":[
               {
                  "id":289020003,
                  "enabled":true,
                  "name":"Name Surname",
                  "email":"agent@callfire.com",
                  "lastLogin":1469538170000,
                  "campaignIds":[
                     13175997004
                  ]
               }
            ]
         }
      }
   ]
}


InboundText
{
   "timestamp":1469540830377,
   "webhookId":3749003,
   "webhookName":"Test Webhook",
   "resourceType":"InboundText",
   "events":[
      {
         "timestamp":1469540830377,
         "webhookId":3749003,
         "resourceType":"InboundText",
         "eventType":"Finished",
         "resource":{
            "id":1023905054003,
            "fromNumber":"12132041238",
            "toNumber":"14246525473",
            "state":"FINISHED",
            "campaignId":9362663003,
            "contact":{
               "id":537189974003,
               "firstName":"testFirstName",
               "lastName":"testLastName",
               "zipcode":"90025",
               "homePhone":"12132041238",
               "workPhone":"12132041238"
            },
            "inbound":true,
            "created":1469540830000,
            "modified":1469540828000,
            "labels":[
               "Test"
            ],
            "message":"Test Message",
            "finalTextResult":"RECEIVED",
            "records":[
               {
                  "id":570794145003,
                  "billedAmount":1.0,
                  "finishTime":1469540830000,
                  "switchId":"cde3d029-2e9e-49a6-9a79-5abdc1402b55",
                  "callerName":"router",
                  "message":"Test Message",
                  "textResult":"RECEIVED"
               }
            ],
            "media":[
            ]
         }
      }
   ]
}


OutboundText
{
   "timestamp":1469540830377,
   "webhookId":3749003,
   "webhookName":"Test Webhook",
   "resourceType":"OutboundText",
   "events":[
      {
         "timestamp":1469540830377,
         "webhookId":3749003,
         "resourceType":"OutboundText",
         "eventType":"Finished",
         "resource":{
            "id":1023905054003,
            "fromNumber":"12132041238",
            "toNumber":"14246525473",
            "state":"FINISHED",
            "campaignId":9362663003,
            "contact":{
               "id":537189974003,
               "firstName":"testFirstName",
               "lastName":"testLastName",
               "zipcode":"90025",
               "homePhone":"12132041238",
               "workPhone":"12132041238"
            },
            "inbound":true,
            "created":1469540830000,
            "modified":1469540828000,
            "labels":[
               "Test"
            ],
            "message":"Test Message",
            "finalTextResult":"RECEIVED",
            "records":[
               {
                  "id":570794145003,
                  "billedAmount":1.0,
                  "finishTime":1469540830000,
                  "switchId":"cde3d029-2e9e-49a6-9a79-5abdc1402b55",
                  "callerName":"router",
                  "message":"Test Message",
                  "textResult":"RECEIVED"
               }
            ],
            "media":[
            ]
         }
      }
   ]
}


InboundCall
{
   "timestamp":1469540830377,
   "webhookId":3749003,
   "webhookName":"Test Webhook",
   "resourceType":"InboundCall",
   "events":[
      {
         "timestamp":1469540830377,
         "webhookId":3749003,
         "resourceType":"InboundCall",
         "eventType":"Finished",
         "resource":{
            "id":1024990109003,
            "fromNumber":"12132212384",
            "toNumber":"12132041238",
            "state":"FINISHED",
            "campaignId":13194908003,
            "batchId":11305143003,
            "contact":{
               "id":537189974003,
               "firstName":"testFirstName",
               "lastName":"testLastName",
               "zipcode":"90025",
               "homePhone":"12132041238",
               "workPhone":"12132041238"
            },
            "inbound":false,
            "created":1469565220000,
            "modified":1469565232000,
            "labels":[
               "Test Label 1",
               "Test Label 2"
            ],
            "finalCallResult":"AM",
            "records":[
               {
                  "id":571797202003,
                  "billedAmount":1,
                  "finishTime":1469565233000,
                  "switchId":"fcd580c2-4e9e-49db-b3fb-7bb9a4fa1fa7",
                  "callerName":"c14h.cf5.kernelfire.com",
                  "result":"AM",
                  "originateTime":1469565225000,
                  "answerTime":1469565227000,
                  "duration":6
               }
            ],
            "agentCall":false
         }
      }
   ]
}


OutboundCall
{
   "timestamp":1469540830377,
   "webhookId":3749003,
   "webhookName":"Test Webhook",
   "resourceType":"OutboundCall",
   "events":[
      {
         "timestamp":1469540830377,
         "webhookId":3749003,
         "resourceType":"OutboundCall",
         "eventType":"Finished",
         "resource":{
            "id":1024990109003,
            "fromNumber":"12132212384",
            "toNumber":"12132041238",
            "state":"FINISHED",
            "campaignId":13194908003,
            "batchId":11305143003,
            "contact":{
               "id":537189974003,
               "firstName":"testFirstName",
               "lastName":"testLastName",
               "zipcode":"90025",
               "homePhone":"12132041238",
               "workPhone":"12132041238"
            },
            "inbound":false,
            "created":1469565220000,
            "modified":1469565232000,
            "labels":[
               "Test Label 1",
               "Test Label 2"
            ],
            "finalCallResult":"AM",
            "records":[
               {
                  "id":571797202003,
                  "billedAmount":1,
                  "finishTime":1469565233000,
                  "switchId":"fcd580c2-4e9e-49db-b3fb-7bb9a4fa1fa7",
                  "callerName":"c14h.cf5.kernelfire.com",
                  "result":"AM",
                  "originateTime":1469565225000,
                  "answerTime":1469565227000,
                  "duration":6
               }
            ],
            "agentCall":false
         }
      }
   ]
}


Have more questions? Submit a request

Comments