{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","params":[],"settings":"","results":{"codes":[]}},"next":{"description":"","pages":[]},"title":"Click-to-Agent","type":"basic","slug":"click-to-agent","excerpt":"Used to initiate a phone call between a Call Distributor Agent and a third party","body":"[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Use the Click-to-Agent API to initiate a phone call with a click of a mouse.\"\n}\n[/block]\nThe Click-to-call API is used to initiate a phone call between a Call Distributor Agent and a third party.\n[block:callout]\n{\n \"type\": \"info\",\n \"title\": \"Base URL for Click-to-Agent\",\n \"body\": \"https://secure.dialogtech.com/ibp_api.php\"\n}\n[/block]\n\n[block:api-header]\n{\n \"title\": \"Parameter List\"\n}\n[/block]\n\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Parameter\",\n \"h-1\": \"Required\",\n \"h-2\": \"Accepts\",\n \"0-0\": \"access_key\",\n \"0-1\": \"Yes\",\n \"1-0\": \"secret_access_key\",\n \"1-2\": \"String\",\n \"2-0\": \"action\",\n \"2-1\": \"Yes\",\n \"4-0\": \"agent_id\",\n \"4-2\": \"String\",\n \"4-1\": \"Yes\",\n \"5-0\": \"phone_to_call\",\n \"5-2\": \"String: Unformatted Phone Number\",\n \"6-0\": \"first_callerid\",\n \"6-2\": \"String: Unformatted Phone Number\",\n \"7-0\": \"second_callerid\",\n \"7-1\": \"No\",\n \"1-1\": \"Yes\",\n \"0-2\": \"String\",\n \"2-2\": \"String: **clickto.agent**\",\n \"h-3\": \"Max Length\",\n \"0-3\": \"n/a\",\n \"5-1\": \"Yes\",\n \"h-4\": \"Notes\",\n \"h-5\": \"Usage\",\n \"0-4\": \"Access Key from the Key Manager within a DialogTech account\",\n \"0-5\": \"Credentials used for access to the API for a particular DialogTech account\",\n \"1-4\": \"Secret Access Key from the Key Manager within a DialogTech account\",\n \"1-3\": \"n/a\",\n \"2-3\": \"n/a\",\n \"2-4\": \"Only accepts **clickto.agent** for click-to-agent\",\n \"3-0\": \"queue_id\",\n \"3-1\": \"Yes\",\n \"3-2\": \"String\",\n \"3-3\": \"n/a\",\n \"3-4\": \"The building block ID of the queue the agent is a member of.\",\n \"4-3\": \"n/a\",\n \"5-3\": \"n/a\",\n \"1-5\": \"Credentials used for access to the API for a particular DialogTech account\",\n \"2-5\": \"Defines the API call as a \\\"Click-to-Agent\\\" type\",\n \"3-5\": \"Defines queue the call will use to be delivered to the appropriate agent.\",\n \"4-4\": \"The Agent ID of the agent receiving the call\",\n \"4-5\": \"Defines the agent who will be a party on the call\",\n \"5-5\": \"Defines the third party who the agent will be reaching out to\",\n \"6-1\": \"No\",\n \"6-3\": \"n/a\",\n \"6-4\": \"Must be a registered number, one of the two numbers being dialed, or tracking number within the DialogTech account.\",\n \"6-5\": \"Defines the Caller ID utilized on the first leg of the call to the agent\",\n \"7-5\": \"Defines the Caller ID utilized on the second leg of the call to the `phone_to_call` third party\",\n \"7-2\": \"String: Unformatted Phone Number\",\n \"7-3\": \"n/a\",\n \"7-4\": \"Must be a registered number, one of the two numbers being dialed, or tracking number within the DialogTech account.\",\n \"5-4\": \"Can be any unformatted phone number\",\n \"8-0\": \"record\",\n \"8-1\": \"No\",\n \"8-2\": \"**0** or **1**\",\n \"8-3\": \"n/a\",\n \"8-4\": \"**0** - Do not record the call (default)\\n**1** - Record the call\",\n \"8-5\": \"Indicates if the call will be recorded or not\",\n \"9-0\": \"warning\",\n \"9-1\": \"No\",\n \"9-2\": \"**0** or **1** or **2** or **3**\",\n \"9-3\": \"n/a\",\n \"9-4\": \"**0** - Do not play a call recording warning\\n**1** - Play call recording warning for both parties (default)\\n**2** - Play call recording warning for just the agent\\n**3** - Play call recording warning for just the `phone_to_call` third party\",\n \"9-5\": \"Indicates if the call recording warning will be played, and to which parties on the call.\"\n },\n \"cols\": 6,\n \"rows\": 10\n}\n[/block]\n\n[block:api-header]\n{\n \"title\": \"Using this API\"\n}\n[/block]\n\n[block:callout]\n{\n \"type\": \"warning\",\n \"title\": \"Agent Mode\",\n \"body\": \"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\\n* `Open`\\n* `Outbound`\\n* `Busy (Work)`\"\n}\n[/block]\nThese code examples are meant to show a basic method of accessing DialogTech's click-to-call API.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<?php\\n /*\\n Click-to-Agent Example:\\n This example will place a call between\\n a specific agent and a third party.\\n */\\n\\n\\t// create curl resource\\n\\t$ch = curl_init(); \\n\\t$baseuri = \\\"https://secure.dialogtech.com/ibp_api.php?\\\";\\n\\t\\n // API Specific Static Parameters\\n $action = \\\"clickto.agent\\\";\\n\\n\\t// Required User Parameters\\n\\t$access_key = \\\"foo\\\";\\n\\t$secret_access_key = \\\"bar\\\";\\n\\t$queue_id = \\\"12345\\\";\\n\\t$agent_id = \\\"98765\\\";\\n\\t$phone_to_call = \\\"5551112222\\\";\\n\\n\\t// Optional Parameters\\n\\t$first_callerid = \\\"9998887777\\\"; // Will display as the Caller ID for the agent\\n\\t$second_callerid = \\\"8887776666\\\"; // Will display as the Caller ID for the 'phone_to_call`\\n\\n // Construct the full URL\\n $full_url = $baseuri . \\\"&action=\\\" . $action .\\n \\\"&access_key=\\\" . $access_key .\\n \\\"&secret_access_key=\\\" . $secret_access_key .\\n \\\"&queue_id=\\\" . $queue_id .\\n \\\"&agent_id=\\\" . $agent_id .\\n \\\"&phone_to_call=\\\" . $phone_to_call .\\n \\\"&first_callerid=\\\" . $first_callerid .\\n \\\"&second_callerid=\\\" . $second_callerid;\\n\\n // Set the URL\\n curl_setopt($ch, CURLOPT_URL, $full_url);\\n \\n // Sets the return options of the cURL to return the actual result from the curl request, and FALSE on failure\\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\\n \\n // Sets the $output variable to the result of the curl\\n $output = curl_exec($ch); \\n \\n // Close curl resource to free up system resources\\n curl_close($ch);\\n\\n // Send the API output to the php page\\n echo $output;\\n?>\",\n \"language\": \"php\",\n \"name\": \"PHP Example\"\n }\n ]\n}\n[/block]\n**Example Response**\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<response>\\n\\t<result>success</result>\\n\\t<result_description>Request Processed</result_description>\\n\\t<sid>170101aabbccddee</sid>\\n</response>\",\n \"language\": \"text\",\n \"name\": \"Success\"\n }\n ]\n}\n[/block]","updates":[],"order":6,"isReference":false,"hidden":true,"sync_unique":"","link_url":"","link_external":false,"_id":"590b7a15c0161e190095435d","category":{"sync":{"isSync":false,"url":""},"pages":["558dbe324cd25f0d00b7ecce","558dbe407afc102f008ed8a4","558dbe567afc102f008ed8a9","558dbe677afc102f008ed8ac","558dbe7e4cd25f0d00b7ecd0","558dbea37afc102f008ed8b2","558dbeb27afc102f008ed8b4","558dbec14cd25f0d00b7ecd2","558dbed0beb7c719007f63b4","558dbf61beb7c719007f63ba"],"title":"Call Initiation APIs","slug":"call-initiation-api","order":2,"from_sync":false,"reference":false,"_id":"558db0bc7afc102f008ed863","version":"558d9c33beb7c719007f631c","createdAt":"2015-06-26T20:06:20.813Z","project":"558d9c32beb7c719007f6319","__v":10},"user":"58cadf93d223510f005d27db","__v":0,"createdAt":"2017-05-04T18:59:33.073Z","githubsync":"","parentDoc":null,"version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["558d9c33beb7c719007f631d","558db0bc7afc102f008ed863","558db0d07afc102f008ed864","558db3c84cd25f0d00b7ecb2","558dbace7afc102f008ed894","558dbd104cd25f0d00b7ecca","558dbd4c4cd25f0d00b7eccb","559d3e858639bd21008e90a6","55bb8ca5a8400c2d00873e70","58fdfb438fbd2819000db9eb","590829c7ade4172d006a87b8","59082a11beedcf0f00235d87","5908bd2cba2afd23007d6d12","5908d1f64f544425002b6aae","591e5e9e2c1b1f0f000fa4e5","5a283434aba91f002834ea86","5a69fe5cde745d002c936c66","5a81e6ef761cf300127317f8","5a81e7d63b1e120012bed5a1","5f6cf225ba56a40011bff62d","5f970e8b7617eb041ae758bb","602adb88243fbc0056918566","602adbb91828a600535980c4"],"_id":"558d9c33beb7c719007f631c","createdAt":"2015-06-26T18:38:43.154Z","project":"558d9c32beb7c719007f6319","releaseDate":"2015-06-26T18:38:43.153Z","__v":23},"project":"558d9c32beb7c719007f6319"}
Click-to-Agent
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
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.
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.
/*
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>