API used to get a report of Call Details over a given date range.
Use the Call Detail Report API to get Call Details
The Call Detail Report API is used to get a report of call details over a given date range. With dozens of fields available, the Call Detail Report is DialogTech's most robust and most popular reporting API.
Base URL for Call Detail Report
Parameter List
Parameter | Required | Accepts | Max Length | Notes | Usage |
---|---|---|---|---|---|
action | Yes | String: report.call_detail | n/a | Only accepts report.call_detail for Call Detail reporting | Defines the API Call as "Call Detail 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 |
activity_info | No | 0 or 1 | n/a | 0 - Do not include activity_info 1 - Include activity_info | A list of the applications and transfers a particular call utilized |
activity_keyword | No | 0 or 1 | n/a | 0 - Do not include activity_keyword 1 - Include activity_keyword | The URL tag from SourceTrak that caused the number to rotate (i.e. gclid= *) |
adj_enhanced | No | 0 or 1 | n/a | 0 - Do not include adj_enhanced 1 - Include adj_enhanced | Duration of enhanced minutes rounded up to the nearest minute |
adj_network | No | 0 or 1 | n/a | 0 - Do not include adj_network 1 - Include adj_network | Duration of intelligent minutes rounded up to the nearest minute |
adj_switch | No | 0 or 1 | n/a | 0 - Do not include adj_switch 1 - Include adj_switch | Duration of talk minutes rounded up to the nearest minute |
ani | No | 0 or 1 | n/a | 0 - Do not include ani 1 - Include ani | Caller ID of the caller |
call_duration | No | 0 or 1 | n/a | 0 - Do not include call_duration 1 - Include call_duration | Duration of call rounded up to the nearest minute |
call_transfer_status | No | 0 or 1 | n/a | 0 - Do not include call_transfer_status 1 - Include call_transfer_status | The result of a call's transfer from DialogTech |
call_type | No | 0 or 1 | n/a | 0 - Do not include call_type 1 - Include call_type | The type of call on DialogTech's platform |
call_type_filter | No | All, Inbound, Outbound, or Click-To | n/a | All - Include all calls (Default) Inbound - Only include inbound calls Outbound - Only include outbound calls Click-To - Only include click-to calls | Filters the results to only include specific call types |
call_type_value | No | 0 or 1 | n/a | 0 - Do not include call_type_value 1 - Include call_type_value | If call_type_filter is set to Inbound then set call_type_value to one of your inbound numbers to filter the report by that number.If call_type_filter is set to Click-To then set call_type_value to be the building block ID of one of your Click-To's.If call_type_filter is set to Outbound then call_type_value is not required |
campaign | No | 0 or 1 | n/a | 0 - Do not include campaign 1 - Include campaign | The paid search campaign from a SourceTrak click. Note: utm_campaign must be used within the a paid search destination URL |
city | No | 0 or 1 | n/a | 0 - Do not include city 1 - Include city | City of caller if reverse-lookup is enabled and data was found |
click_description | No | 0 or 1 | n/a | 0 - Do not include click_description 1 - Include click_description | If the call was initiated using a Click-to-Call this will show the description was assigned to that Click-to-Call. |
conversion | No | 0 or 1 | n/a | 0 - Do not include conversion 1 - Include conversion | |
conversion_amount | No | 0 or 1 | n/a | 0 - Do not include conversion_amount 1 - Include conversion_amount | |
conversion_note | No | 0 or 1 | n/a | 0 - Do not include conversion_note 1 - Include conversion_note | |
custom_id | No | 0 or 1 | n/a | 0 - Do not include custom_id 1 - Include custom_id | The value of the _st_custom_id variable used with SourceTrak from a website visitor |
custom_value | No | 0 or 1 | n/a | 0 - Do not include custom_value 1 - Include custom_value | The value of the _st_custom_value variable used with SourceTrak from a website visitor |
date_added | No | 0 or 1 | n/a | 0 - Do not include date_added 1 - Include date_added | Date and time the call was made. |
dnis | No | 0 or 1 | n/a | 0 - Do not include dnis 1 - Include dnis | The number dialed |
domain | No | 0 or 1 | n/a | 0 - Do not include domain 1 - Include domain | The URL where a visitor originated |
end_time | No | String | 8 | Time is in hh:mm:ss 24-hour format. | Daily end time. Must be used with start_time to create a daily time range. Time is in hh:mm:ss 24-hour format. Example: 1:30pm would be written as 13:30:00. |
enhanced_minutes | No | 0 or 1 | n/a | 0 - Do not include enhanced_minutes 1 - Include enhanced_minutes | The duration, in tenths of a minute, when a call is being recorded or live-monitored |
extension_adgroup | No | 0 or 1 | n/a | 0 - Do not include extension_adgroup 1 - Include extension_adgroup | The Adwords Adgroup associated to Legacy Google Call Extension click-to-call data. Improved call extension data is provided in the Bid Management API. |
extension_keywords | No | 0 or 1 | n/a | 0 - Do not include extension_keywords 1 - Include extension_keywords | The Adwords Keywords associated to Legacy Google Call Extension click-to-call data. Improved call extension data is provided in the Bid Management API. |
findme_number_label | No | 0 or 1 | n/a | 0 - Do not include findme_number_label 1 - Include findme_number_label | The label associated with a FindMe transfer number |
first_activity | No | 0 or 1 | n/a | 0 - Do not include first_activity 1 - Include first_activity | First application/action taken when the call came in |
first_name | No | 0 or 1 | n/a | 0 - Do not include first_name 1 - Include first_name | First name of caller if reverse-lookup is enabled and data was found |
format | No | xml or csv | n/a | xml - Return data in xml format csv - Return data in csv format | Determines the format used to return the report |
ga_client_id | No | 0 or 1 | n/a | 0 - Do not include ga_client_id 1 - Include ga_client_id | The Google Universal Analytics assigned Client ID of a website visitor |
gclid | No | 0 or 1 | n/a | 0 - Do not include gclid 1 - Include gclid | The Google Adwords assigned Google Click Identifier of a website visitor |
geo_lookup_attempt | No | 0 or 1 | n/a | 0 - Do not include geo_lookup_attempt 1 - Include geo_lookup_attempt | |
geo_lookup_result | No | 0 or 1 | n/a | 0 - Do not include geo_lookup_result 1 - Include geo_lookup_result | |
inbound_ani_type | No | 0 or 1 | n/a | 0 - Do not include inbound_ani_type 1 - Include inbound_ani_type | The type of device used by the inbound caller (ie mobile or landline) |
last_activity | No | 0 or 1 | n/a | 0 - Do not include last_activity 1 - Include last_activity | The last application used, or last action taken for a the call |
last_name | No | 0 or 1 | n/a | 0 - Do not include last_name 1 - Include last_name | Last name of caller if reverse-lookup is enabled and data was found |
location_name | No | 0 or 1 | n/a | 0 - Do not include location_name 1 - Include location_name | The name of the SourceTrak location associated with the call |
netget_status | No | 0 or 1 | n/a | 0 - Do not include netget_status 1 - Include netget_status | A status of a NetGet attempt for the call |
network_minutes | No | 0 or 1 | n/a | 0 - Do not include network_minutes 1 - Include network_minutes | Duration, in tenths of a minute, that two parties are connected together. Also referred to as Talk time |
phone_label | No | 0 or 1 | n/a | 0 - Do not include phone_label 1 - Include phone_label | The label assigned to the phone number |
platform | No | 0 or 1 | n/a | 0 - Do not include platform 1 - Include platform | |
pool_name | No | 0 or 1 | n/a | 0 - Do not include pool_name 1 - Include pool_name | The SourceTrak pool a particular dialed-number is associated with |
recording | No | 0 or 1 | n/a | 0 - Do not include recording 1 - Include recording | A link to the recording of the call, if one exists. |
ring_time | No | 0 or 1 | n/a | 0 - Do not include ring_time 1 - Include ring_time | Ring time in seconds. This is populated only for certain transfer types |
search_term | No | 0 or 1 | n/a | 0 - Do not include search_term 1 - Include search_term | The literal search string (keywords) that resulted in the display of a phone number on a website. |
sid | No | 0 or 1 | n/a | 0 - Do not include sid 1 - Include sid | Unique DialogTech assigned identifier for the call |
sourceguard | No | 0 or 1 | n/a | 0 - Do not include sourceguard 1 - Include sourceguard | Returns 0 or 1, 0 indicates the call was not a SourceTrak SourceGuard call, 1 indicates the call was a SourceTrak SourceGuard call |
start_time | No | String | 8 | Time is in hh:mm:ss 24-hour format. | Daily start time. Must be used with end_time to create a daily time range. Time is in hh:mm:ss 24-hour format. Example: 1:30pm would be written as 13:30:00. |
state | No | 0 or 1 | n/a | 0 - Do not include state 1 - Include state | State of caller if reverse-lookup is enabled and data was found |
street_address | No | 0 or 1 | n/a | 0 - Do not include street_address 1 - Include street_address | Street address of caller if reverse-lookup is enabled and data was found |
switch_minutes | No | 0 or 1 | n/a | 0 - Do not include switch_minutes 1 - Include switch_minutes | The duration, in tenths of a minute, a call is on the system while not connected to another party. |
transfer_to_number | No | 0 or 1 | n/a | 0 - Do not include transfer_to_number 1 - Include transfer_to_number | The number the call was transferred to. |
transfer_type | No | 0 or 1 | n/a | 0 - Do not include transfer_type 1 - Include transfer_type | When a call is transferred, returns what initiated the transfer such as FindMe Transfer |
url_tag | No | 0 or 1 | n/a | 0 - Do not include url_tag 1 - Include url_tag | The URL tag from SourceTrak that caused the number to rotate with wildcards replaced by the value associated with the website visit (i.e. st-t=google_bogo_campaign as opposed to st-t=google_ *) |
valuetrack | No | 0 or 1 | n/a | 0 - Do not include valuetrack 1 - Include valuetrack | See ValueTrack Parameters table |
zipcode | No | 0 or 1 | n/a | 0 - Do not include zipcode 1 - Include zipcode | Zip code address of caller if reverse-lookup is enabled and data was found |
search_sid | No | String | n/a | Sid corresponding to a desired call record | Filters the results to only include a specific call sharing the Session ID of the search_sid provided |
ValueTrack Parameters
When valuetrack=1
is added to your API call, a number of fields are automatically added to the response. These values are populated primarily by using DialogTech's ValueTrack parameters with SourceTrak. Please contact your account manager with questions about using ValueTrack parameters within SourceTrak.
Field name | Description |
---|---|
Keyword | For the Search Network: the keyword from your account that is matched to the search query. For the Display Network: the keyword from your account that is matched to the content. |
Match Type | The match type of the keyword that triggered your ad: "e" for exact, "p" for phrase, or "b" for "broad" |
Network | Where the click came from: "g" for Google search, "s" for a search partner, or "d" for the Display Network |
Device | What device the click came from: "m" for mobile (including WAP), "t" for tablet, and "c" for computer |
Device Model | What model of phone or tablet the click came from (for example, "Apple+iPhone"). Note: only available on Display Network campaigns |
Creative | A unique ID for your ad |
Placement | The content site where your ad was clicked (for keyword-targeted campaigns), or the matching placement targeting criteria for the site where your ad was clicked (for placement-targeted campaigns) |
Target | A placement category (works with placement-targeted campaigns only) |
Param1 | Creative parameter #1, if you're using the AdParamService with the AdWords API |
Param2 | Creative parameter #2, if you're using the AdParamService with the AdWords API |
Random | A random Google-generated number (an unsigned 64-bit integer), commonly used to force the page to reload |
Ace ID | A Google parameter that is a control or experiment ID from an Adwords campaign experiment. |
Ad Position | The position on the page that your ad appeared in, with a value like "1t2"(this means page 1, top, position 2) |
Product Target | Identify a specific brand or products and are used in PLA campaigns to match to product targets. |
Ad Type | Google offers several different options for the varieties of ad that may appear on your pages and in your reports. Here's what you may see: Text (includes text ads that have been rendered in the "display-like" magazine style format) Image Rich media Flash Video Animated image Audio Link units |
sources:
https://support.google.com/adwords/answer/6305348
https://support.google.com/adsense/answer/164735
Using this API
These code examples are meant to show a basic method of accessing DialogTech's IVR Report API.
<?php
/*
Call Detail Report EX:
This example request a Call Detail Report.
It will then create an html table to
display on the page with the following
Call Detail Report fields selected
date_added
sid
activity_info
dnis
ani
enhanced_minutes
call_duration
transfer_to_number
phone_label
*/
// Create cURL resource
$ch = curl_init();
$baseuri = "https://secure.dialogtech.com/ibp_api.php?";
// API Specific Static Parameters
$action = "report.call_detail";
// Required User Parameters To Request the API
$access_key = "foo";
$secret_access_key = "bar";
$start_date = "20170101";
$end_date = "20170102";
// Parameters that define the fields returned
$activity_info = "1";
$ani = "1";
$call_duration = "1";
$call_type_filter = "All";
$date_added = "1";
$dnis = "1";
$enhanced_minutes = "1";
$format = "csv";
$phone_label = "1";
$sid = "1";
$transfer_to_number = "1";
// 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 .
"&activity_info=" . $activity_info .
"&ani=" . $ani .
"&call_duration=" . $call_duration .
"&call_type_filter=" . $call_type_filter .
"&date_added=" . $date_added .
"&dnis=" . $dnis .
"&enhanced_minutes=" . $enhanced_minutes .
"&format=" . $format .
"&phone_label=" . $phone_label .
"&sid=" . $sid .
"&transfer_to_number=" . $transfer_to_number;
// 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>";
// Create the table
$table = "<table>";
$rows = str_getcsv($output, "\n");
foreach($rows as &$row) {
// Add new row
$table .= "<tr>";
$cells = str_getcsv($row);
foreach($cells as &$cell) {
// Add a new cell
$table .= "<td>$cell</td>";
}
// Complete the new row
$table .= "</tr>";
}
// Complete the table
$table .= "</table>";
// Echo the CSS and table on the page
echo $page_html . $table;
?>
curl -X ""
Example Response
<?xml version='1.0' encoding='iso-8859-1'?>
<!DOCTYPE data [
<!ELEMENT data (record+)>
<!ELEMENT record (date_added,sid,activity_info,dnis,ani,enhanced_minutes,call_duration,transfer_to_number,phone_label)>
<!ELEMENT date_added (#PCDATA)>
<!ELEMENT sid (#PCDATA)>
<!ELEMENT activity_info (#PCDATA)>
<!ELEMENT dnis (#PCDATA)>
<!ELEMENT ani (#PCDATA)>
<!ELEMENT enhanced_minutes (#PCDATA)>
<!ELEMENT call_duration (#PCDATA)>
<!ELEMENT transfer_to_number (#PCDATA)>
<!ELEMENT phone_label (#PCDATA)>
]>
<data>
<record>
<date_added>2017-01-01 09:49:04</date_added>
<sid>170101f3aac4938f</sid>
<activity_info>Login acct: 0000 CID: 5551111111 DNIS: 5552222222</activity_info>
<dnis>5552222222</dnis>
<ani>5551111111</ani>
<enhanced_minutes>0.0</enhanced_minutes>
<call_duration>1</call_duration>
<transfer_to_number></transfer_to_number>
<phone_label></phone_label>
</record>
<record>
<date_added>2017-01-02 08:27:00</date_added>
<sid>1701023daf0f0c79</sid>
<activity_info>Login acct: 0000 CID: 5553333333 DNIS: 5552222222</activity_info>
<dnis>5552222222</dnis>
<ani>5553333333</ani>
<enhanced_minutes>0.0</enhanced_minutes>
<call_duration>1</call_duration>
<transfer_to_number></transfer_to_number>
<phone_label></phone_label>
</record>
<record>
<date_added>2017-01-02 15:06:02</date_added>
<sid>170102f1ca7ab510</sid>
<activity_info>Login acct: 0000 CID: 5554444444 DNIS: 5555555555,Transfer | 5556666666</activity_info>
<dnis>5555555555</dnis>
<ani>5554444444</ani>
<enhanced_minutes>0.7</enhanced_minutes>
<call_duration>1</call_duration>
<transfer_to_number>5556666666</transfer_to_number>
<phone_label>On Call Number</phone_label>
</record>
<record>
<date_added>2017-01-02 15:08:09</date_added>
<sid>170102aaea59fe69</sid>
<activity_info>Login acct: 0000 CID: 5557777777 DNIS: 5558888888</activity_info>
<dnis>5558888888</dnis>
<ani>5557777777</ani>
<enhanced_minutes>0.0</enhanced_minutes>
<call_duration>1</call_duration>
<transfer_to_number></transfer_to_number>
<phone_label>212 Pool</phone_label>
</record>
</data>
"date_added","sid","activity_info","dnis","ani","enhanced_minutes","call_duration","transfer_to_number","phone_label"
"2017-01-01 09:49:04","170101f3aac4938f","Login acct: 0000 CID: 5551111111 DNIS: 5552222222","5552222222","5551111111","0.0","1","",""
"2017-01-02 08:27:00","1701023daf0f0c79","Login acct: 0000 CID: 5553333333 DNIS: 5552222222","5552222222","5553333333","0.0","1","",""
"2017-01-02 15:06:02","170102f1ca7ab510","Login acct: 0000 CID: 5554444444 DNIS: 5555555555,Transfer | 5556666666","5555555555","5557777777","0.7","1","5556666666","On Call Number"
"2017-01-02 15:08:09","170102aaea59fe69","Login acct: 0000 CID: 5559999999 DNIS: 5558888888","5558888888","5559999999","0.0","1","","PPC Pool"