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 name | Required | Description |
---|
key | Y | The API key that is registered with your account |
cfacct | Y | The Campaign id of your click to call campaign |
phonenumber | Y | The phone number you want to connect |
info | Y | Any extra information you wish to store for this connection ( Name or Email Address are common ) |
delay | Y | The 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 name | Required | Description |
---|
cfacct | Y | The Campaign id of your click to call campaign |
phonenumber | Y | The phone number you want to connect |
info | Y | Any extra information you wish to store for this connection ( Name or Email Address are common ) |
delay | Y | 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&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"?> |
| <soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
| <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." |
| "; |
| } |
| } |
| catch(SoapFault $error) |
| { |
| if($debug) |
| { |
| echo $error." |
| "; |
| } |
| } |
| } |
Sample C# Code
| public long 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 |
| { |
| |
| } |
| } |
sendConnection
Use this function to send out a connection for a campaign that you created.
Parameters
Parameter name | Required | Description |
---|
key | Y | The API key that is registered with your account |
cfacct | Y | This is the campaign id for which you want to send out the connection |
phonenumber | Y | This is the phone number to which the connection call would be made. |
info | Y | Any extra information you wish to store for this connection |
delay | Y | 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:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> |
| <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." |
| "; |
| } |
| } |
| } |
Sample C# Code
| public void sendConnection(string key, int cfacct, string phonenumber, string info, int delay) |
| { |
| |
| try |
| { |
| this.clickToCallAPI.sendConnection(key, cfacct, phonenumber, info, delay); |
| } |
| finally |
| { |
| |
| } |
| } |