Used to initiate a phone call between a Call Distributor Agent and a third party
Use the Click-to-Agent API to initiate a phone call with a click of a mouse.
The Click-to-call API is used to initiate a phone call between a Call Distributor Agent and a third party.
Base URL for Click-to-Agent
Parameter List
Parameter | Required | Accepts | Max Length | Notes | Usage |
---|---|---|---|---|---|
access_key | Yes | String | n/a | Access Key from the Key Manager within a DialogTech account | Credentials used for access to the API for a particular DialogTech account |
secret_access_key | Yes | String | n/a | Secret Access Key from the Key Manager within a DialogTech account | Credentials used for access to the API for a particular DialogTech account |
action | Yes | String: clickto.agent | n/a | Only accepts clickto.agent for click-to-agent | Defines the API call as a "Click-to-Agent" type |
queue_id | Yes | String | n/a | The building block ID of the queue the agent is a member of. | Defines queue the call will use to be delivered to the appropriate agent. |
agent_id | Yes | String | n/a | The Agent ID of the agent receiving the call | Defines the agent who will be a party on the call |
phone_to_call | Yes | String: Unformatted Phone Number | n/a | Can be any unformatted phone number | Defines the third party who the agent will be reaching out to |
first_callerid | No | String: Unformatted Phone Number | n/a | Must 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 to the agent |
second_callerid | No | String: Unformatted Phone Number | n/a | Must 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 to the phone_to_call third party |
record | No | 0 or 1 | n/a | 0 - Do not record the call (default) 1 - Record the call | Indicates if the call will be recorded or not |
warning | No | 0 or 1 or 2 or 3 | n/a | 0 - Do not play a call recording warning 1 - Play call recording warning for both parties (default) 2 - Play call recording warning for just the agent 3 - Play call recording warning for just the phone_to_call third party | Indicates if the call recording warning will be played, and to which parties on the call. |
Using this API
Agent Mode
The call will update the agent status to
OUTBOUND
as a result of this API call. The agent must be in one of the following modes for the call to successfully reach them
Open
Outbound
Busy (Work)
These code examples are meant to show a basic method of accessing DialogTech's click-to-call API.
<?php
/*
Click-to-Agent Example:
This example will place a call between
a specific agent and a third party.
*/
// create curl resource
$ch = curl_init();
$baseuri = "https://secure.dialogtech.com/ibp_api.php?";
// API Specific Static Parameters
$action = "clickto.agent";
// Required User Parameters
$access_key = "foo";
$secret_access_key = "bar";
$queue_id = "12345";
$agent_id = "98765";
$phone_to_call = "5551112222";
// Optional Parameters
$first_callerid = "9998887777"; // Will display as the Caller ID for the agent
$second_callerid = "8887776666"; // Will display as the Caller ID for the 'phone_to_call`
// Construct the full URL
$full_url = $baseuri . "&action=" . $action .
"&access_key=" . $access_key .
"&secret_access_key=" . $secret_access_key .
"&queue_id=" . $queue_id .
"&agent_id=" . $agent_id .
"&phone_to_call=" . $phone_to_call .
"&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
<response>
<result>success</result>
<result_description>Request Processed</result_description>
<sid>170101aabbccddee</sid>
</response>