Used to get a report of all click-to activity in a given date range.
Use the Click-to Report API to get Click-to activity
The Click-to Report API is used to get a report of all click-to activity in a given date range. This will include activity from
- Click-to-Call
- Click-to-FindMe
- Click-to-FindMe List
- Click-to-Virtual Receptionist
- Click-to-Voicemail
- Click-to-IVR
- Click-to-Agent
Base URL for Click-to Report
Parameter List
Parameter | Required | Accepts | Max Length | Notes | Usage |
---|---|---|---|---|---|
action | Yes | String: report.clickto | n/a | Only accepts report.clickto for Click-to Report | Defines the API Call as "Click-to Report" type |
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 |
start_date | Yes | Date | 8 | Date format should be YYYYMMDD | Defines the start of the date-range for records to be returned from |
end_date | Yes | Date | 8 | Date format should be YYYYMMDD | Defines the end of the date-range for records to be returned from |
format | No | String: xml or csv | 3 | xml - XML format csv - csv format | Determines the output format for the response, as either xml or csv |
click_id | No | Click-to ID | n/a | Click-to building block ID within the specified date range Default is all click-to's | Filters the response to only return click-to's where the click-to building block ID matches the click-id provided. |
ref | No | String | n/a | Custom reference used within the specified date range | Filters the response to only return records where the Custom reference from the Smart Click-to-Call Report matches the ref provided. |
Using this API
These code examples are meant to show a basic method of accessing DialogTech's Click-to Report API.
<?php
/*
Broadcast Report EX:
This example will request a Broadcast
report. It will then create an html
table to display on the page with all
available Broadcast Report fields.
*/
// Create cURL resource
$ch = curl_init();
$baseuri = "https://secure.dialogtech.com/ibp_api.php?";
// API Specific Static Parameters
$action = "report.clickto";
// Required User Parameters To Request the API
$access_key = "foo";
$secret_access_key = "bar";
$start_date = "20170101";
$end_date = "20170131";
$format = "csv";
// Construct the full URL
$full_url = $baseuri . "&action=" . $action .
"&access_key=" . $access_key .
"&secret_access_key=" . $secret_access_key .
"&start_date=" . $start_date .
"&end_date=" . $end_date .
"&format=" . $format;
// 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);
// Basic CSS for the table formatting
$page_html = "<style>
td
{
border-left:1px solid black;
border-top:1px solid black;
text-align:center;
}
table
{
border-right:1px solid black;
border-bottom:1px solid black;
}
</style>\n\n";
// Create the table
$table = "<table>\n";
$rows = str_getcsv($output, "\n");
foreach($rows as &$row) {
// Add new row
$table .= " <tr>\n";
$cells = str_getcsv($row);
foreach($cells as &$cell) {
// Add a new cell
$table .= " <td>$cell</td>\n";
}
// Complete the new row
$table .= " </tr>\n";
}
// Complete the table
$table .= "</table>";
// Echo the CSS and table on the page
echo $page_html . $table;
?>
Example Response
<?xml version='1.0' encoding='iso-8859-1'?>
<!DOCTYPE data [
<!ELEMENT data (record+)>
<!ELEMENT record (Caller_ID,Name,Page,Ref,Click_Description,Click_Date_Time,Number_Connected,Call_Duration,Referral_Keywords,Referral_Domain,IP_Address,Call_1_Result,Call_2_Result)>
<!ELEMENT Caller_ID (#PCDATA)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Page (#PCDATA)>
<!ELEMENT Ref (#PCDATA)>
<!ELEMENT Click_Description (#PCDATA)>
<!ELEMENT Click_Date_Time (#PCDATA)>
<!ELEMENT Number_Connected (#PCDATA)>
<!ELEMENT Call_Duration (#PCDATA)>
<!ELEMENT Referral_Keywords (#PCDATA)>
<!ELEMENT Referral_Domain (#PCDATA)>
<!ELEMENT IP_Address (#PCDATA)>
<!ELEMENT Call_1_Result (#PCDATA)>
<!ELEMENT Call_2_Result (#PCDATA)>
]>
<data>
<record>
<Caller_ID>0001112222</Caller_ID>
<Name>Click to Call</Name>
<Page></Page>
<Ref></Ref>
<Click_Description>On Call Number</Click_Description>
<Click_Date_Time>Jan 13 2017 10:52 PM</Click_Date_Time>
<Number_Connected>5556667777</Number_Connected>
<Call_Duration>9</Call_Duration>
<Referral_Keywords></Referral_Keywords>
<Referral_Domain></Referral_Domain>
<IP_Address>127.0.0.1</IP_Address>
<Call_1_Result>ANSWER</Call_1_Result>
<Call_2_Result>ANSWER</Call_2_Result>
</record>
<record>
<Caller_ID>0001112222</Caller_ID>
<Name></Name>
<Page></Page>
<Ref></Ref>
<Click_Description>URL based</Click_Description>
<Click_Date_Time>Feb 01 2017 3:57 PM</Click_Date_Time>
<Number_Connected>9998887777</Number_Connected>
<Call_Duration>1</Call_Duration>
<Referral_Keywords></Referral_Keywords>
<Referral_Domain></Referral_Domain>
<IP_Address>192.168.1.1</IP_Address>
<Call_1_Result>ANSWER</Call_1_Result>
<Call_2_Result>ANSWER</Call_2_Result>
</record>
</data>
"Caller ID","Name","Page","Ref","Click Description","Click Date/Time","Number Connected","Call Duration","Referral Keywords","Referral Domain","IP Address","Call 1 Result","Call 2 Result"
"0001112222","Click to Call","","","On Call Number","Jan 13 2017 10:52 PM","5556667777","9","","","127.0.0.1","ANSWER","ANSWER"
"0001112222","","","","URL based","Feb 01 2017 3:57 PM","9998887777","1","","","192.168.1.1","ANSWER","ANSWER"