API & DOCS

My Account            

Used to initiate a phone call directly between two phone numbers.

Use the Click-to-Call API to initiate a phone call with a click of a mouse.

The Click-to-call API is used to initiate a phone call directly between two phone numbers. Depending on the parameters used, the order in which numbers are dialed can be modified.

📘

Base URL for Click-to-Call

https://secure.dialogtech.com/ibp_api.php

Parameter List

ParameterRequiredAcceptsMax LengthNotesUsage
access_keyYes* (See Notes)Stringn/aAccess Key from the Key Manager within a DialogTech accountCredentials used for access to the API for a particular DialogTech account
secret_access_keyYes* (See Notes)Stringn/aSecret Access Key from the Key Manager within a DialogTech accountCredentials used for access to the API for a particular DialogTech account
actionYesString: clickto.calln/aOnly accepts clickto.call for click-to-callDefines the API call as a "Click-to-call" type
typeYesString: 1 or 2n/a1 - Call phone_to_call first
2 - Call id first
Determines the order in which the various numbers are dialed
idYesString: Unformatted Phone Numbern/aMust be a registered number, or tracking number within the DialogTech account if key is being utilized. If access_key and secret_access_key are being utilized, this can be any number.Defines one of the numbers being used in the click-to-call
phone_to_callYesString: Unformatted Phone Numbern/aCan be any unformatted phone numberDefines one of the numbers being used in the click-to-call
pageNoString255Will be stored in the Smart Click-to-Call ReportDefines the "page" the click-to-call originated from.
refNoString32Will be stored in the Smart Click-to-Call ReportCan be used to pass in a reference string to be available in Click-to-Call reporting
first_calleridNoString: Unformatted Phone Numbern/aMust be a registered number, one of the two numbers being dialed, or tracking number within the DialogTech account.Defines the Caller ID utilized on the first leg of the call
second_calleridNoString: Unformatted Phone Numbern/aMust be a registered number, one of the two numbers being dialed, or tracking number within the DialogTech account.Defines the Caller ID utilized on the second leg of the call

Using this API

These code examples are meant to show a basic method of accessing DialogTech's click-to-call API.

<?php
    /*
        Click-to-Call Example:
        This example will use access_key and secret_access_key.
        This means the two numbers being dialed by this 
        click-to-call are not required to be registered numbers
        or tracking numbers within your DialogTech account.
    */

	// create curl resource
	$ch = curl_init(); 
	$baseuri = "https://secure.dialogtech.com/ibp_api.php?";
	
    // API Specific Static Parameters
    $action = "clickto.call";

	// Required User Parameters
	$access_key = "foo";
	$secret_access_key = "bar";
    $type = "1";
    $id = "8772955100";
    $phone_to_call = "5551112222";
    $page = "home.html";
    $first_callerid = "9998887777"; // Will display as the Caller ID for the 'phone_to_call' recipient as type=1
    $second_callerid = "8887776666"; // Will display as the Caller ID for the 'id' recipient as type=1

    // Construct the full URL
    $full_url = $baseuri . "&action=" . $action .
        "&access_key=" . $access_key .
        "&secret_access_key=" . $secret_access_key .
        "&type=" . $type .
        "&id=" . $id .
        "&phone_to_call=" . $phone_to_call .
        "&page=" . $page .
        "&first_callerid=" . $first_callerid .
        "&second_callerid=" . $second_callerid;

    // Set the URL
    curl_setopt($ch, CURLOPT_URL, $full_url);
    
    // Sets the return options of the cURL to return the actual result from the curl request, and FALSE on failure
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        
    // Sets the $output variable to the result of the curl
    $output = curl_exec($ch); 
    
    // Close curl resource to free up system resources
    curl_close($ch);

    // Send the API output to the php page
    echo $output;
?>

Example Response

When requesting the click-to-call API, the client side response will only populate after the first leg of the call is answered or not. The response will be a plain-text string indicating the success/failure of the first leg of the call.

Call Connected
No Answer