Skip to main content

You can run a click to call connection using SOAP or REST.

Methods

Click to Call (SOAP)

WSDL

https://www.callfire.com/service/ClickToCallAPI?wsdl

Parameters

Parameter nameRequiredDescription
keyYThe API key that is registered with your account
cfacctYThe Campaign id of your click to call campaign
phonenumberYThe phone number you want to connect
infoYAny extra information you wish to store for this connection ( Name or Email Address are common )
delayYThe number of minutes to time delay before making the call ( 0 for no delays )

Click to Call (REST)

URL

https://www.callfire.com/service/clicktocall/sendconnect

Parameters

Parameter nameRequiredDescription
cfacctYThe Campaign id of your click to call campaign
phonenumberYThe phone number you want to connect
infoYAny extra information you wish to store for this connection ( Name or Email Address are common )
delayYThe number of minutes to time delay before making the call ( 0 for no delays )

Example — https://www.callfire.com/service/clicktocall/sendconnect?cfacct=1&phone…

Where Campaign ID is 1, Number to connect is 123-123-3214, jaa13@gmail.com is additional information and the call is instant (0 delay)

createClickToCallCampaign

Example Request

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

  
    
      string
      string
      string
    
  

Sample PHP Code

public function createClickToCallCampaign($api_key, $caller_id, $transferNumber, $awayMessage, $debug)
{
	$createOtboundcampaignWsdl = 'http://www.callfire.com/service/ClickToCallAPI?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'callerid' => $caller_id,
  		'transferNumber' => $transferNumber,
   	'awayMessage' => $awayMessage
	);
	try
	{
		$createClickToCallCampaignResponse = $campaignOutboundClient->createClickToCallCampaign($createcampaign);
		$campaignId = $createClickToCallCampaignResponse->out;
		if($debug)
		{
			echo "CampaignID : ".$campaignId."
";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public long createClickToCallCampaign(string key, string callerid, string transferNumber, string awayMessage)
{
    //LOG.Info("Entered createClickToCallCampaign(string key, string callerid, string transferNumber, string awayMessage)");
    try
    {
        long campaignId = (long) this.clickToCallAPI.createClickToCallCampaign(key, callerid, transferNumber, awayMessage);
        return campaignId;
    }
    catch (Exception e)
    {
        string msg = "Unable to create click to call campaign";
        LOG.Error(msg);
        throw new ClickToCallServiceException(msg, e);
    }
    finally
    {
        //LOG.Info("Exited createClickToCallCampaign(string key, string callerid, string transferNumber, string awayMessage)");
    }
}

sendConnection

Use this function to send out a connection for a campaign that you created.

Parameters

Parameter nameRequiredDescription
keyYThe API key that is registered with your account
cfacctYThis is the campaign id for which you want to send out the connection
phonenumberYThis is the phone number to which the connection call would be made.
infoYAny extra information you wish to store for this connection
delayYEnter the time in minutes after which the call would be made to the phone number that you specified.

Example Request

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

  
    
      string
      3892
      string
      string
      -5337
    
  

Sample PHP Code

public function sendConnection($api_key,$cfacct,$phoneNumber,$info,$delay,$debug)
{
	$createOtboundcampaignWsdl = 'http://www.callfire.com/service/ClickToCallAPI?wsdl';
	$campaignOutboundClient = new SoapClient($createOtboundcampaignWsdl,array('trace' => true));

	$createcampaign = array(
  		'key' => $api_key,
  		'cfacct' => $cfacct,
  		'phonenumber' => $phoneNumber,
   	'info' => $info,
	'delay' => $delay
	);
	try
	{
		$sendconnectionResponse = $campaignOutboundClient->sendConnection($createcampaign);
		$campaignId = $sendconnectionResponse->out;
		if($debug)
		{
			echo "Connection sent success";
		}
	}
	catch(SoapFault $error)
	{
		if($debug)
		{
			echo $error."
";
		}
	}
}

Sample C# Code

public void sendConnection(string key, int cfacct, string phonenumber, string info, int delay)
{
    //LOG.Info("Entered sendConnection(string key, int cfacct, string phonenumber, string info, int delay)");
    try
    {
        this.clickToCallAPI.sendConnection(key, cfacct, phonenumber, info, delay);
    }
    finally
    {
        //LOG.Info("Exited sendConnection(string key, int cfacct, string phonenumber, string info, int delay)");
    }
}