{"_id":"58fdfa5879c6e825005ed5e0","version":{"_id":"558d9c33beb7c719007f631c","project":"558d9c32beb7c719007f6319","__v":19,"createdAt":"2015-06-26T18:38:43.154Z","releaseDate":"2015-06-26T18:38:43.153Z","categories":["558d9c33beb7c719007f631d","558db0bc7afc102f008ed863","558db0d07afc102f008ed864","558db3c84cd25f0d00b7ecb2","558dbace7afc102f008ed894","558dbd104cd25f0d00b7ecca","558dbd4c4cd25f0d00b7eccb","559d3e858639bd21008e90a6","55bb8ca5a8400c2d00873e70","58fdfb438fbd2819000db9eb","590829c7ade4172d006a87b8","59082a11beedcf0f00235d87","5908bd2cba2afd23007d6d12","5908d1f64f544425002b6aae","591e5e9e2c1b1f0f000fa4e5","5a283434aba91f002834ea86","5a69fe5cde745d002c936c66","5a81e6ef761cf300127317f8","5a81e7d63b1e120012bed5a1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"__v":0,"category":{"_id":"59082a11beedcf0f00235d87","project":"558d9c32beb7c719007f6319","version":"558d9c33beb7c719007f631c","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-05-02T06:41:21.140Z","from_sync":false,"order":4,"slug":"reporting-apis","title":"Reporting APIs"},"githubsync":"","project":"558d9c32beb7c719007f6319","user":"58cadf93d223510f005d27db","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-04-24T13:15:04.618Z","link_external":false,"link_url":"","sync_unique":"","hidden":true,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":4,"body":"[block:api-header]\n{\n  \"title\": \"Use the Click-to Report API to get Click-to activity\"\n}\n[/block]\nThe 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\n  * Click-to-Call\n  * Click-to-FindMe\n  * Click-to-FindMe List\n  * Click-to-Virtual Receptionist\n  * Click-to-Voicemail\n  * Click-to-IVR\n  * Click-to-Agent\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Base URL for Click-to Report\",\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    \"h-3\": \"Max Length\",\n    \"h-4\": \"Notes\",\n    \"h-5\": \"Usage\",\n    \"0-0\": \"action\",\n    \"0-1\": \"Yes\",\n    \"0-2\": \"String: **report.clickto**\",\n    \"0-3\": \"n/a\",\n    \"0-4\": \"Only accepts **report.clickto** for Click-to Report\",\n    \"0-5\": \"Defines the API Call as \\\"Click-to Report\\\" type\",\n    \"1-0\": \"access_key\",\n    \"1-1\": \"Yes\",\n    \"1-2\": \"String\",\n    \"1-3\": \"n/a\",\n    \"2-0\": \"secret_access_key\",\n    \"2-1\": \"Yes\",\n    \"2-2\": \"String\",\n    \"2-3\": \"n/a\",\n    \"1-4\": \"Access Key from the Key Manager within a DialogTech account\",\n    \"1-5\": \"Credentials used for access to the API for a particular DialogTech account\",\n    \"2-5\": \"Credentials used for access to the API for a particular DialogTech account\",\n    \"2-4\": \"Secret Access Key from the Key Manager within a DialogTech account\",\n    \"3-0\": \"start_date\",\n    \"4-0\": \"end_date\",\n    \"5-0\": \"format\",\n    \"6-0\": \"click_id\",\n    \"7-0\": \"ref\",\n    \"3-1\": \"Yes\",\n    \"3-2\": \"Date\",\n    \"4-2\": \"Date\",\n    \"4-1\": \"Yes\",\n    \"5-1\": \"No\",\n    \"5-2\": \"String: **xml** or **csv**\",\n    \"5-3\": \"3\",\n    \"5-4\": \"**xml** - XML format\\n**csv** - csv format\",\n    \"5-5\": \"Determines the output format for the response, as either xml or csv\",\n    \"6-1\": \"No\",\n    \"6-2\": \"Click-to ID\",\n    \"6-3\": \"n/a\",\n    \"6-4\": \"Click-to building block ID within the specified date range\\n\\nDefault is all click-to's\",\n    \"6-5\": \"Filters the response to only return click-to's where the *click-to building block ID* matches the `click-id` provided.\",\n    \"7-1\": \"No\",\n    \"7-2\": \"String\",\n    \"7-3\": \"n/a\",\n    \"7-4\": \"Custom reference used within the specified date range\",\n    \"7-5\": \"Filters the response to only return records where the *Custom reference* from the *Smart Click-to-Call Report* matches the `ref` provided.\",\n    \"3-3\": \"8\",\n    \"4-3\": \"8\",\n    \"3-4\": \"Date format should be YYYYMMDD\",\n    \"4-4\": \"Date format should be YYYYMMDD\",\n    \"3-5\": \"Defines the start of the date-range for records to be returned from\",\n    \"4-5\": \"Defines the end of the date-range for records to be returned from\"\n  },\n  \"cols\": 6,\n  \"rows\": 8\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Using this API\"\n}\n[/block]\nThese code examples are meant to show a basic method of accessing DialogTech's Click-to Report API.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n  /*\\n    Broadcast Report EX:\\n    This example will request a Broadcast \\n    report. It will then create an html \\n    table to display on the page with all \\n    available Broadcast Report fields.\\n  */\\n\\n  // Create cURL resource\\n  $ch = curl_init(); \\n  $baseuri = \\\"https://secure.dialogtech.com/ibp_api.php?\\\";\\n\\n  // API Specific Static Parameters\\n  $action = \\\"report.clickto\\\";\\n\\n  // Required User Parameters To Request the API\\n  $access_key = \\\"foo\\\";\\n  $secret_access_key = \\\"bar\\\";\\n  $start_date = \\\"20170101\\\";\\n  $end_date = \\\"20170131\\\";\\n  $format = \\\"csv\\\";\\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    \\\"&start_date=\\\" . $start_date .\\n    \\\"&end_date=\\\" . $end_date .\\n    \\\"&format=\\\" . $format;\\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  // Basic CSS for the table formatting\\n  $page_html = \\\"<style>\\n  td\\n  {\\n    border-left:1px solid black;\\n    border-top:1px solid black;\\n    text-align:center;\\n  }\\n  table\\n  {\\n    border-right:1px solid black;\\n    border-bottom:1px solid black;\\n  }\\n</style>\\\\n\\\\n\\\";\\n\\n\\n  // Create the table\\n  $table = \\\"<table>\\\\n\\\";\\n  $rows = str_getcsv($output, \\\"\\\\n\\\");\\n\\n  foreach($rows as &$row) {\\n    // Add new row\\n    $table .= \\\" <tr>\\\\n\\\";\\n    $cells = str_getcsv($row);\\n\\n    foreach($cells as &$cell) {\\n      // Add a new cell\\n      $table .= \\\"   <td>$cell</td>\\\\n\\\";\\n    }\\n\\n    // Complete the new row\\n    $table .= \\\" </tr>\\\\n\\\";\\n  }\\n\\n  // Complete the table\\n  $table .= \\\"</table>\\\";\\n\\n  // Echo the CSS and table on the page\\n  echo $page_html . $table;\\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\": \"<?xml version='1.0' encoding='iso-8859-1'?>\\n<!DOCTYPE data [\\n  <!ELEMENT data (record+)>\\n  <!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)>\\n   <!ELEMENT Caller_ID (#PCDATA)>\\n   <!ELEMENT Name (#PCDATA)>\\n   <!ELEMENT Page (#PCDATA)>\\n   <!ELEMENT Ref (#PCDATA)>\\n   <!ELEMENT Click_Description (#PCDATA)>\\n   <!ELEMENT Click_Date_Time (#PCDATA)>\\n   <!ELEMENT Number_Connected (#PCDATA)>\\n   <!ELEMENT Call_Duration (#PCDATA)>\\n   <!ELEMENT Referral_Keywords (#PCDATA)>\\n   <!ELEMENT Referral_Domain (#PCDATA)>\\n   <!ELEMENT IP_Address (#PCDATA)>\\n   <!ELEMENT Call_1_Result (#PCDATA)>\\n   <!ELEMENT Call_2_Result (#PCDATA)>\\n]>\\n<data>\\n    <record>\\n        <Caller_ID>0001112222</Caller_ID>\\n        <Name>Click to Call</Name>\\n        <Page></Page>\\n        <Ref></Ref>\\n        <Click_Description>On Call Number</Click_Description>\\n        <Click_Date_Time>Jan 13 2017 10:52 PM</Click_Date_Time>\\n        <Number_Connected>5556667777</Number_Connected>\\n        <Call_Duration>9</Call_Duration>\\n        <Referral_Keywords></Referral_Keywords>\\n        <Referral_Domain></Referral_Domain>\\n        <IP_Address>127.0.0.1</IP_Address>\\n        <Call_1_Result>ANSWER</Call_1_Result>\\n        <Call_2_Result>ANSWER</Call_2_Result>\\n    </record>\\n    <record>\\n        <Caller_ID>0001112222</Caller_ID>\\n        <Name></Name>\\n        <Page></Page>\\n        <Ref></Ref>\\n        <Click_Description>URL based</Click_Description>\\n        <Click_Date_Time>Feb 01 2017 3:57 PM</Click_Date_Time>\\n        <Number_Connected>9998887777</Number_Connected>\\n        <Call_Duration>1</Call_Duration>\\n        <Referral_Keywords></Referral_Keywords>\\n        <Referral_Domain></Referral_Domain>\\n        <IP_Address>192.168.1.1</IP_Address>\\n        <Call_1_Result>ANSWER</Call_1_Result>\\n        <Call_2_Result>ANSWER</Call_2_Result>\\n    </record>\\n</data>\",\n      \"language\": \"xml\",\n      \"name\": \"xml\"\n    },\n    {\n      \"code\": \"\\\"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\\\"\\n\\\"0001112222\\\",\\\"Click to Call\\\",\\\"\\\",\\\"\\\",\\\"On Call Number\\\",\\\"Jan 13 2017 10:52 PM\\\",\\\"5556667777\\\",\\\"9\\\",\\\"\\\",\\\"\\\",\\\"127.0.0.1\\\",\\\"ANSWER\\\",\\\"ANSWER\\\"\\n\\\"0001112222\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"URL based\\\",\\\"Feb 01 2017 3:57 PM\\\",\\\"9998887777\\\",\\\"1\\\",\\\"\\\",\\\"\\\",\\\"192.168.1.1\\\",\\\"ANSWER\\\",\\\"ANSWER\\\"\",\n      \"language\": \"text\",\n      \"name\": \"csv\"\n    }\n  ]\n}\n[/block]","excerpt":"Used to get a report of all click-to activity in a given date range.","slug":"click-to-report","type":"basic","title":"Click-to Report"}

Click-to Report

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

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

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"