Skip to main content

This rest api will enable reports to be sent (via file stream) back to your server. You can subscribe to call finishes and campaign finishes. CallFire can POST raw XML to your site after any calls or texts that occur on your account.

Call Reports

Subscribe to Call Reports

Use the API to subscribe and unsubscribe dynamically.

URL

https://www.callfire.com/cloud/1/reports/callback/callfinish

HTTP Method

POST

Content Type

text/plain or application/x-www-form-urlencoded

Parameters

Parameter nameRequiredDescription
apikeyYThe API key that is registered with your account
postUrlYThe postback URL

Example Response

xml
<?xml version="1.0" encoding="UTF-8" standalone="yes">
<reportresponse>
<description>Saved</description>
<success>true</success>
</reportresponse>

Sample C# Code

Before using this code:

  1. Download the PostRequest.cs file: here
csharp
PostSubmitter post = new PostSubmitter();
post.Url = "https://www.callfire.com/cloud/1/reports/callback/callfinish";
post.PostItems.Add("apikey", "YOUR_API_KEY");
post.PostItems.Add("postUrl", "ENTER_THE_POST_BACK_URL");
post.Type = PostSubmitter.PostTypeEnum.Post;
string result = post.Post();
Console.WriteLine("Result is");
Console.WriteLine(result);

Subscribe to Call Reports for a Single Campaign

Use this API and CallFire can send call-finished XML to be 'POST'ed to your site for a campaign specified only. You can have different location for different campaigns.

URL

https://www.callfire.com/cloud/1/reports/callback/callfinish/{campaignid}

HTTP Method

POST

Content Type

text/plain or application/x-www-form-urlencoded

Parameters

Parameter nameRequiredDescription
apikeyYThe API key that is registered with your account
postUrlYThe postback URL

Example Response

xml
<?xml version="1.0" encoding="UTF-8" standalone="yes">
<reportresponse>
<description>Saved</description>
<success>true</success>
</reportresponse>

Sample C# Code

Before using this code:

  1. Download the PostRequest.cs file: here
  2. Replace the {campaignid} in the code given below with your campaign id
csharp
PostSubmitter post = new PostSubmitter();
post.Url = "https://www.callfire.com/cloud/1/reports/callback/callfinish/{campaignid}";
post.PostItems.Add("apikey", "YOUR_API_KEY");
post.PostItems.Add("postUrl", "ENTER_THE_POST_BACK_URL");
post.Type = PostSubmitter.PostTypeEnum.Post;
string result = post.Post();
Console.WriteLine("Result is");
Console.WriteLine(result);

Call Finish Postback

Sample Call Postback

xml
<?xml version="1.0" encoding="UTF-8"?>
<call-finished>
<callid>111111</callid>
<campaignid>22222</campaignid>
<phonenumber>2132212289</phonenumber>
<dnis>8778973473</dnis>
<tags>
<tag>sales number</tag>
<tag>houston</tag>
</tags>
<disposition>TRANSFER</disposition>
<duration>35</duration>
<callstart>2010-03-24 15:58:18.0</callstart>
<notes>
notes that a call center campaign will add to a call.
</notes>
<extra-data>
additional data uploaded with the phone number
</extra-data>
<agentid>21212</agentid>
<agentresponse>interested</agentresponse>
<responsetime>2010-03-24 15:58:38.0</responsetime>
<stored-data>
<var name="bigconcern">economy</var>
<var name="willvote">yes</var>
</stored-data>
<recordings>
<file>
https://www.callfire.com/cloud/1/files/recording/
</file>
</recordings>
</call-finished>

Sample Text Sent Postback

xml
<?xml version="1.0" encoding="UTF-8"?>
<call-finished>
<callid>111111</callid>
<campaignid>22222</campaignid>
<phonenumber>2132212289</phonenumber>
<dnis>88202</dnis>
<smssent>sent message</smssent>
<disposition>LA</disposition>
<duration>60</duration>
<callstart>2011-06-27 17:18:55.0</callstart>
<notes>
<extra-data>
<stored-data>
<recordings>
</recordings></stored-data></extra-data></notes></call-finished>

Sample Text Reply Postback

<?xml version="1.0" encoding="UTF-8"?>

	111111
	22222
	2132212289
	88202
	Reply message
	2740908
	LA
	60
	2011-06-27 17:18:55.0
	
	
	
	

Parsing Call Reports

CallFire will post pure XML to your server. You could parse results using the following snippet of php.

Sample PHP Code

<?php
$inputSocket = fopen('php://input','rb');
$contents = stream_get_contents($inputSocket);
fclose($inputSocket);

$xml = simplexml_load_string($contents);

$callstart = $xml->callstart;
$phonenumber = $xml->phonenumber;
$disposition = $xml->disposition;

// for anything that was "stash"ed from IVR campaigns
foreach ($xml->stored-data->var as $var) {
       $varName = $var['name'];
       $varValue = $var;
}

// for sms replies
if (isset($xml->smsReceived))
       $smsReply = $xml->smsReceived;


?>

Campaign Reports

Subscribe to Campaigns Finished

Use this and CallFire will POST campaign-finished XML to your site.

URL

https://www.callfire.com/cloud/1/reports/callback/campaignfinish

HTTP Method

POST

Content Type

text/plain or application/x-www-form-urlencoded

Parameters

Parameter nameRequiredDescription
apikeyYThe API key that is registered with your account
postUrlYThe postback URL

Example Response

<?xml version="1.0" encoding="UTF-8" standalone="yes">

    Saved
    true

Sample C# Code

Before using this code:

  1. Download the PostRequest.cs file: here
PostSubmitter post = new PostSubmitter();
post.Url = "https://www.callfire.com/cloud/1/reports/callback/campaignfinish";
post.PostItems.Add("apikey", "YOUR_API_KEY");
post.PostItems.Add("postUrl", "ENTER_THE_POST_BACK_URL");
post.Type = PostSubmitter.PostTypeEnum.Post;
string result = post.Post();
Console.WriteLine("Result is");
Console.WriteLine(result);

Campaign Finished Postback

<?xml version="1.0" encoding="UTF-8"?>

	
		22222
		My Campaign Name
		finished
		$2.25
		
			100
			100
			48
			24
			12
			0
			6
			10
			0
			0