Click to call API

Contents

Click to Call Service

Description

You can run a click to call connection using SOAP or REST. There is also a Single Bridge Call API if you just want to connect two callers.

Click to Call Soap API

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

Variables:

  • key: The API Key for your Account
  • cfacct: The Campaign id of your click to call campaign
  • phonenumber: The phone number you want to connect
  • info: Any extra information you wish to store for this connection ( Name or Email Address are common )
  • delay: The number of minutes to time delay before making the call ( 0 for no delays )

Click to Call REST API

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

Variables:

  • cfacct: The Campaign id of your click to call campaign
  • phonenumber: The phone number you want to connect
  • info: Any extra information you wish to store for this connection ( Name or Email Address are common )
  • delay: The number of minutes to time delay before making the call ( 0 for no delays )

Example: https://www.callfire.com/service/clicktocall/sendconnect?cfacct=1&phonenumber=1231233214&info=jaa13@gmail.com&delay=0

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"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <tnsa:createClickToCallCampaign xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tnsa="http://clicktocall.service.dialer.skyyconsulting.com" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tnsa:key>string</tnsa:key>
      <tnsa:transferNumber>string</tnsa:transferNumber>
      <tnsa:awayMessage>string</tnsa:awayMessage>
    </tnsa:createClickToCallCampaign>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


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."<br/>";
			}
		}
		catch(SoapFault $error)
		{
			if($debug)
			{
				echo $error."<br/>";
			}
		}
	}
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

  • key - This is the key that you were provided when you registered with callfire.com. You can view your key by logging onto callfire.com & then goto "Settings -> Account Settings".
  • cfacct - This is the campaign id for which you want to send out the connection
  • phonenumber - This is the phone number to which the connection call would be made.
  • info -
  • delay - Enter 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"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Body>
    <tnsa:sendConnection xmlns:tns="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:tnsa="http://clicktocall.service.dialer.skyyconsulting.com" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <tnsa:key>string</tnsa:key>
      <tnsa:cfacct>3892</tnsa:cfacct>
      <tnsa:phonenumber>string</tnsa:phonenumber>
      <tnsa:info>string</tnsa:info>
      <tnsa:delay>-5337</tnsa:delay>
    </tnsa:sendConnection>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


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."<br/>";
			}
		}
	}
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)");
            }
        }