{"_id":"58fdfaa1c1e51e19004129fd","parentDoc":null,"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"},"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"},"project":"558d9c32beb7c719007f6319","__v":0,"githubsync":"","user":"58cadf93d223510f005d27db","updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-04-24T13:16:17.947Z","link_external":false,"link_url":"","sync_unique":"","hidden":true,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":5,"body":"[block:api-header]\n{\n  \"title\": \"Use the IVR API to get IVR Respondent data\"\n}\n[/block]\nThe IVR Report API is used to get a report of all IVR/SurVo responses over a given date range. There are options available to return call detail records SourceTrak attribution details alongside the IVR responses.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Base URL for IVR 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.survo**\",\n    \"0-3\": \"n/a\",\n    \"0-4\": \"Only accepts **report.survo** for IVR Reporting\",\n    \"0-5\": \"Defines the API Call as \\\"IVR 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    \"6-0\": \"format\",\n    \"7-0\": \"include_cdr\",\n    \"8-0\": \"include_st\",\n    \"3-1\": \"Yes\",\n    \"3-2\": \"Date\",\n    \"4-2\": \"Date\",\n    \"4-1\": \"Yes\",\n    \"6-1\": \"No\",\n    \"6-2\": \"String: **xml** or **csv**\",\n    \"6-3\": \"3\",\n    \"6-4\": \"**xml** - XML format\\n**csv** - csv format\",\n    \"6-5\": \"Determines the output format for the response, as either xml or csv\",\n    \"7-1\": \"No\",\n    \"7-2\": \"**0** or **1**\",\n    \"7-3\": \"n/a\",\n    \"7-4\": \"**0** - Do not include additional columns from the Call Detail Report\\n**1** - Include additional columns from the Call Detail Report\",\n    \"7-5\": \"Adds additional columns from the *Call Detail Report* alongside the IVR Respondent data\",\n    \"8-1\": \"No\",\n    \"8-2\": \"**0** or **1**\",\n    \"8-3\": \"n/a\",\n    \"8-4\": \"**0** - Do not include additional columns from SourceTrak\\n**1** - Include additional columns from SourceTrak\",\n    \"8-5\": \"Adds additional columns from *SourceTrak* alongside the IVR Respondent data\",\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    \"5-0\": \"id\",\n    \"5-1\": \"Yes\",\n    \"5-2\": \"String\",\n    \"5-3\": \"n/a\",\n    \"5-4\": \"IVR building block ID within the specified date range\",\n    \"5-5\": \"Filters the response to only return IVR Respondent data where the *IVR Building Block ID* matches the `id` provided.\"\n  },\n  \"cols\": 6,\n  \"rows\": 9\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 IVR Report API.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<?php\\n\\t/*\\n\\t\\tIVR Report EX:\\n\\t\\tThis example will request an IVR report. \\n\\t\\tIt will then create an html table to \\n\\t\\tdisplay on the page with all available\\n\\t\\tIVR fields.\\n\\t*/\\n\\n\\t// Create cURL resource\\n\\t$ch = curl_init(); \\n\\t$baseuri = \\\"https://secure.dialogtech.com/ibp_api.php?\\\";\\n\\n\\t// API Specific Static Parameters\\n\\t$action = \\\"report.survo\\\";\\n\\n\\t// Required User Parameters To Request the API\\n\\t$access_key = \\\"foo\\\";\\n\\t$secret_access_key = \\\"bar\\\";\\n\\t$start_date = \\\"20170401\\\";\\n\\t$end_date = \\\"20170430\\\";\\n\\t$id = \\\"1105795\\\";\\n\\n\\t// Parameters that define the fields returned\\n\\t$include_cdr = \\\"1\\\";\\n\\t$include_st = \\\"1\\\";\\n\\t$format = \\\"csv\\\";\\n\\n\\t// Construct the full URL\\n\\t$full_url = $baseuri . \\\"&action=\\\" . $action .\\n\\t\\t\\\"&access_key=\\\" . $access_key .\\n\\t\\t\\\"&secret_access_key=\\\" . $secret_access_key .\\n\\t\\t\\\"&start_date=\\\" . $start_date .\\n\\t\\t\\\"&end_date=\\\" . $end_date .\\n\\t\\t\\\"&id=\\\" . $id .\\n\\t\\t\\\"&include_cdr=\\\" . $include_cdr .\\n\\t\\t\\\"&include_st=\\\" . $include_st . \\n\\t\\t\\\"&format=\\\" . $format;\\n\\n\\t// Set the URL\\n\\tcurl_setopt($ch, CURLOPT_URL, $full_url);\\n\\n\\t// Sets the return options of the cURL to return the actual result from the curl request, and FALSE on failure\\n\\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\\n\\n\\t// Sets the $output variable to the result of the curl\\n\\t$output = curl_exec($ch);\\n\\n\\t// Close curl resource to free up system resources\\n\\tcurl_close($ch);\\n\\n\\t// Basic CSS for the table formatting\\n\\t$page_html = \\\"<style>\\n\\ttd\\n\\t{\\n\\t\\tborder-left:1px solid black;\\n\\t\\tborder-top:1px solid black;\\n\\t\\ttext-align:center;\\n\\t}\\n\\ttable\\n\\t{\\n\\t\\tborder-right:1px solid black;\\n\\t\\tborder-bottom:1px solid black;\\n\\t}\\n</style>\\\\n\\\\n\\\";\\n\\n\\n\\t// Create the table\\n\\t$table = \\\"<table>\\\\n\\\";\\n\\t$rows = str_getcsv($output, \\\"\\\\n\\\");\\n\\n\\tforeach($rows as &$row) {\\n\\t\\t// Add new row\\n\\t\\t$table .= \\\"\\t<tr>\\\\n\\\";\\n\\t\\t$cells = str_getcsv($row);\\n\\n\\t\\tforeach($cells as &$cell) {\\n\\t\\t\\t// Add a new cell\\n\\t\\t\\t$table .= \\\"\\t\\t<td>$cell</td>\\\\n\\\";\\n\\t\\t}\\n\\n\\t\\t// Complete the new row\\n\\t\\t$table .= \\\"\\t</tr>\\\\n\\\";\\n\\t}\\n\\n\\t// Complete the table\\n\\t$table .= \\\"</table>\\\";\\n\\n\\t// Echo the CSS and table on the page\\n\\techo $page_html . $table;\\n?>\",\n      \"language\": \"text\",\n      \"name\": \"PHP Example\"\n    },\n    {\n      \"code\": \"curl -X \\\"\\\"\",\n      \"language\": \"text\",\n      \"name\": \"cURL\"\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 (Respondent_ID,Caller_ID,Completed,Timestamp,SID,Question_One,Talk_Minutes,Intelligent_Minutes,Call_Type,Phone_Label,Recording,Last_Name,First_Name,Street_Address,City,State,Zip_Code,Transfer_To_Number,Call_Transfer_Status,Inbound_Device_Type,URL_Tag,Domain,Search_Term,Activity_Keyword,Custom_Value,Custom_Id,Google_UA_Client_ID,gclid,Campaign,Pool_Name,Location_Name,Keyword,Match_Type,Network,Device,Device_Model,Creative,Placement,Target,Param1,Param2,Random,Ace_Id,Ad_Position,Product_Target_ID,Ad_Type)>\\n   <!ELEMENT Respondent_ID (#PCDATA)>\\n   <!ELEMENT Caller_ID (#PCDATA)>\\n   <!ELEMENT Completed (#PCDATA)>\\n   <!ELEMENT Timestamp (#PCDATA)>\\n   <!ELEMENT SID (#PCDATA)>\\n   <!ELEMENT Question_One (#PCDATA)>\\n   <!ELEMENT Talk_Minutes (#PCDATA)>\\n   <!ELEMENT Intelligent_Minutes (#PCDATA)>\\n   <!ELEMENT Call_Type (#PCDATA)>\\n   <!ELEMENT Phone_Label (#PCDATA)>\\n   <!ELEMENT Recording (#PCDATA)>\\n   <!ELEMENT Last_Name (#PCDATA)>\\n   <!ELEMENT First_Name (#PCDATA)>\\n   <!ELEMENT Street_Address (#PCDATA)>\\n   <!ELEMENT City (#PCDATA)>\\n   <!ELEMENT State (#PCDATA)>\\n   <!ELEMENT Zip_Code (#PCDATA)>\\n   <!ELEMENT Transfer_To_Number (#PCDATA)>\\n   <!ELEMENT Call_Transfer_Status (#PCDATA)>\\n   <!ELEMENT Inbound_Device_Type (#PCDATA)>\\n   <!ELEMENT URL_Tag (#PCDATA)>\\n   <!ELEMENT Domain (#PCDATA)>\\n   <!ELEMENT Search_Term (#PCDATA)>\\n   <!ELEMENT Activity_Keyword (#PCDATA)>\\n   <!ELEMENT Custom_Value (#PCDATA)>\\n   <!ELEMENT Custom_Id (#PCDATA)>\\n   <!ELEMENT Google_UA_Client_ID (#PCDATA)>\\n   <!ELEMENT gclid (#PCDATA)>\\n   <!ELEMENT Campaign (#PCDATA)>\\n   <!ELEMENT Pool_Name (#PCDATA)>\\n   <!ELEMENT Location_Name (#PCDATA)>\\n   <!ELEMENT Keyword (#PCDATA)>\\n   <!ELEMENT Match_Type (#PCDATA)>\\n   <!ELEMENT Network (#PCDATA)>\\n   <!ELEMENT Device (#PCDATA)>\\n   <!ELEMENT Device_Model (#PCDATA)>\\n   <!ELEMENT Creative (#PCDATA)>\\n   <!ELEMENT Placement (#PCDATA)>\\n   <!ELEMENT Target (#PCDATA)>\\n   <!ELEMENT Param1 (#PCDATA)>\\n   <!ELEMENT Param2 (#PCDATA)>\\n   <!ELEMENT Random (#PCDATA)>\\n   <!ELEMENT Ace_Id (#PCDATA)>\\n   <!ELEMENT Ad_Position (#PCDATA)>\\n   <!ELEMENT Product_Target_ID (#PCDATA)>\\n   <!ELEMENT Ad_Type (#PCDATA)>\\n]>\\n<data>\\n    <record>\\n        <Respondent_ID>1234567890</Respondent_ID>\\n        <Caller_ID>5554443333</Caller_ID>\\n        <Completed>No</Completed>\\n        <Timestamp>2017-01-01 06:00:00</Timestamp>\\n        <SID>170101aaabbbcccd</SID>\\n        <Question_One>user_recordings/555/55555/survey/4444444/1112223334-A1.wav</Question_One>\\n        <Talk_Minutes>0.5</Talk_Minutes>\\n        <Intelligent_Minutes>0.4</Intelligent_Minutes>\\n        <Call_Type>Inbound</Call_Type>\\n        <Phone_Label>Survey Line</Phone_Label>\\n        <Recording></Recording>\\n        <Last_Name>Simpson</Last_Name>\\n        <First_Name>Homer</First_Name>\\n        <Street_Address>742 Evergreen Terrace</Street_Address>\\n        <City>Springfield</City>\\n        <State></State>\\n        <Zip_Code></Zip_Code>\\n        <Transfer_To_Number>5556667890</Transfer_To_Number>\\n        <Call_Transfer_Status>Answer</Call_Transfer_Status>\\n        <Inbound_Device_Type>Undetected</Inbound_Device_Type>\\n        <URL_Tag></URL_Tag>\\n        <Domain></Domain>\\n        <Search_Term></Search_Term>\\n        <Activity_Keyword></Activity_Keyword>\\n        <Custom_Value></Custom_Value>\\n        <Custom_Id></Custom_Id>\\n        <Google_UA_Client_ID></Google_UA_Client_ID>\\n        <gclid></gclid>\\n        <Campaign></Campaign>\\n        <Pool_Name></Pool_Name>\\n        <Location_Name></Location_Name>\\n        <Keyword></Keyword>\\n        <Match_Type></Match_Type>\\n        <Network></Network>\\n        <Device></Device>\\n        <Device_Model></Device_Model>\\n        <Creative></Creative>\\n        <Placement></Placement>\\n        <Target></Target>\\n        <Param1></Param1>\\n        <Param2></Param2>\\n        <Random></Random>\\n        <Ace_Id></Ace_Id>\\n        <Ad_Position></Ad_Position>\\n        <Product_Target_ID></Product_Target_ID>\\n        <Ad_Type></Ad_Type>\\n    </record>\\n    <record>\\n        <Respondent_ID>0009998887</Respondent_ID>\\n        <Caller_ID>5554443333</Caller_ID>\\n        <Completed>Yes</Completed>\\n        <Timestamp>2017-01-01 06:30:00</Timestamp>\\n        <SID>170101cccdddeeef</SID>\\n        <Question_One>user_recordings/555/55555/survey/4444444/9998887776-A1.wav</Question_One>\\n        <Talk_Minutes>0.7</Talk_Minutes>\\n        <Intelligent_Minutes>0.2</Intelligent_Minutes>\\n        <Call_Type>Inbound</Call_Type>\\n        <Phone_Label>Survey Line</Phone_Label>\\n        <Recording></Recording>\\n        <Last_Name>Simpson</Last_Name>\\n        <First_Name>Homer</First_Name>\\n        <Street_Address>742 Evergreen Terrace</Street_Address>\\n        <City>Springfield</City>\\n        <State></State>\\n        <Zip_Code></Zip_Code>\\n        <Transfer_To_Number>5556667890</Transfer_To_Number>\\n        <Call_Transfer_Status>Answer</Call_Transfer_Status>\\n        <Inbound_Device_Type>Undetected</Inbound_Device_Type>\\n        <URL_Tag></URL_Tag>\\n        <Domain></Domain>\\n        <Search_Term></Search_Term>\\n        <Activity_Keyword></Activity_Keyword>\\n        <Custom_Value></Custom_Value>\\n        <Custom_Id></Custom_Id>\\n        <Google_UA_Client_ID></Google_UA_Client_ID>\\n        <gclid></gclid>\\n        <Campaign></Campaign>\\n        <Pool_Name></Pool_Name>\\n        <Location_Name></Location_Name>\\n        <Keyword></Keyword>\\n        <Match_Type></Match_Type>\\n        <Network></Network>\\n        <Device></Device>\\n        <Device_Model></Device_Model>\\n        <Creative></Creative>\\n        <Placement></Placement>\\n        <Target></Target>\\n        <Param1></Param1>\\n        <Param2></Param2>\\n        <Random></Random>\\n        <Ace_Id></Ace_Id>\\n        <Ad_Position></Ad_Position>\\n        <Product_Target_ID></Product_Target_ID>\\n        <Ad_Type></Ad_Type>\\n    </record>\\n</data>\",\n      \"language\": \"xml\",\n      \"name\": \"xml\"\n    },\n    {\n      \"code\": \"\\\"Respondent_ID\\\",\\\"Caller_ID\\\",\\\"Completed\\\",\\\"Timestamp\\\",\\\"SID\\\",\\\"Question_One\\\",\\\"Talk_Minutes\\\",\\\"Intelligent_Minutes\\\",\\\"Call_Type\\\",\\\"Phone_Label\\\",\\\"Recording\\\",\\\"Last_Name\\\",\\\"First_Name\\\",\\\"Street_Address\\\",\\\"City\\\",\\\"State\\\",\\\"Zip_Code\\\",\\\"Transfer_To_Number\\\",\\\"Call_Transfer_Status\\\",\\\"Inbound_Device_Type\\\",\\\"URL_Tag\\\",\\\"Domain\\\",\\\"Search_Term\\\",\\\"Activity_Keyword\\\",\\\"Custom_Value\\\",\\\"Custom_Id\\\",\\\"Google_UA_Client_ID\\\",\\\"gclid\\\",\\\"Campaign\\\",\\\"Pool_Name\\\",\\\"Location_Name\\\",\\\"Keyword\\\",\\\"Match_Type\\\",\\\"Network\\\",\\\"Device\\\",\\\"Device_Model\\\",\\\"Creative\\\",\\\"Placement\\\",\\\"Target\\\",\\\"Param1\\\",\\\"Param2\\\",\\\"Random\\\",\\\"Ace_Id\\\",\\\"Ad_Position\\\",\\\"Product_Target_ID\\\",\\\"Ad_Type\\\"\\n\\\"1234567890\\\",\\\"5554443333\\\",\\\"No\\\",\\\"2017-01-01 06:00:00\\\",\\\"170101aaabbbcccd\\\",\\\"user_recordings/555/55555/survey/4444444/1112223334-A1.wav\\\",\\\"0.5\\\",\\\"0.4\\\",\\\"Inbound\\\",\\\"Survey Line\\\",\\\"\\\",\\\"Simpson\\\",\\\"Homer\\\",\\\"742 Evergreen Terrace\\\",\\\"Springfield\\\",\\\"\\\",\\\"\\\",\\\"5556667890\\\",\\\"Answer\\\",\\\"Undetected\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"\\n\\\"0009998887\\\",\\\"5554443333\\\",\\\"Yes\\\",\\\"2017-01-01 06:30:00\\\",\\\"170101cccdddeeef\\\",\\\"user_recordings/555/55555/survey/4444444/9998887776-A1.wav\\\",\\\"0.7\\\",\\\"0.2\\\",\\\"Inbound\\\",\\\"Survey Line\\\",\\\"\\\",\\\"Simpson\\\",\\\"Homer\\\",\\\"742 Evergreen Terrace\\\",\\\"Springfield\\\",\\\"\\\",\\\"\\\",\\\"5556667890\\\",\\\"Answer\\\",\\\"Undetected\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\",\\\"\\\"\",\n      \"language\": \"text\",\n      \"name\": \"csv\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Response Appendix\"\n}\n[/block]\nThis is a list of each value returned by the IVR Report API and a simple description of what that value represents.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"1-0\": \"Caller_ID\",\n    \"0-0\": \"Respondent_ID\",\n    \"0-1\": \"A unique ID assigned to the respondent\",\n    \"1-1\": \"Caller ID of the respondent\",\n    \"2-1\": \"A Yes/No flag if the IVR was completed normally. No indicates the respondent likely hung up during the IVR\",\n    \"2-0\": \"Completed\",\n    \"3-0\": \"Timestamp\",\n    \"3-1\": \"Response time of the Respondent\",\n    \"4-0\": \"SID\",\n    \"4-1\": \"A unique identifier for the call on the DialogTech system\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"The include_cdr and include_st parameters\"\n}\n[/block]\nAdditional fields are returned when `include_cdr` is selected. Those fields are\n* Talk_Minutes\n* Intelligent_Minutes\n* Call_Type\n* Phone_Label\n* Recording\n* Last_Name\n* First_Name\n* Street_Address\n* City\n* State\n* Zip_Code\n* Transfer_To_Number\n* Call_Transfer_Status\n* Inbound_Device_Type\n\nAdditional fields are returned when `include_st` is utilized. Those fields are\n* URL_Tag\n* Domain\n* Search_Term\n* Activity_Keyword\n* Custom_Value\n* Custom_Id\n* Google_UA_Client_ID\n* gclid\n* Campaign\n* Pool_Name\n* Location_Name\n* Keyword\n* Match_Type\n* Network\n* Device\n* Device_Model\n* Creative\n* Placement\n* Target\n* Param1\n* Param2\n* Random\n* Ace_Id\n* Ad_Position\n* Product_Target_ID\n* Ad_Type\n\nThe definitions of all these fields can be found within the [Call Detail Report](doc:call-detail-report) API documentation.","excerpt":"API used to get a report of all IVR responses over a given date range.","slug":"ivr-report","type":"basic","title":"IVR Report"}

IVR Report

API used to get a report of all IVR responses over a given date range.

Use the IVR API to get IVR Respondent data

The IVR Report API is used to get a report of all IVR/SurVo responses over a given date range. There are options available to return call detail records SourceTrak attribution details alongside the IVR responses.

Parameter List

Parameter
Required
Accepts
Max Length
Notes
Usage

action

Yes

String: report.survo

n/a

Only accepts report.survo for IVR Reporting

Defines the API Call as "IVR 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

id

Yes

String

n/a

IVR building block ID within the specified date range

Filters the response to only return IVR Respondent data where the IVR Building Block ID matches the id provided.

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

include_cdr

No

0 or 1

n/a

0 - Do not include additional columns from the Call Detail Report
1 - Include additional columns from the Call Detail Report

Adds additional columns from the Call Detail Report alongside the IVR Respondent data

include_st

No

0 or 1

n/a

0 - Do not include additional columns from SourceTrak
1 - Include additional columns from SourceTrak

Adds additional columns from SourceTrak alongside the IVR Respondent data

Using this API

These code examples are meant to show a basic method of accessing DialogTech's IVR Report API.

<?php
	/*
		IVR Report EX:
		This example will request an IVR report. 
		It will then create an html table to 
		display on the page with all available
		IVR fields.
	*/

	// Create cURL resource
	$ch = curl_init(); 
	$baseuri = "https://secure.dialogtech.com/ibp_api.php?";

	// API Specific Static Parameters
	$action = "report.survo";

	// Required User Parameters To Request the API
	$access_key = "foo";
	$secret_access_key = "bar";
	$start_date = "20170401";
	$end_date = "20170430";
	$id = "1105795";

	// Parameters that define the fields returned
	$include_cdr = "1";
	$include_st = "1";
	$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 .
		"&id=" . $id .
		"&include_cdr=" . $include_cdr .
		"&include_st=" . $include_st . 
		"&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;
?>
curl -X ""

Example Response

<?xml version='1.0' encoding='iso-8859-1'?>
<!DOCTYPE data [
  <!ELEMENT data (record+)>
  <!ELEMENT record (Respondent_ID,Caller_ID,Completed,Timestamp,SID,Question_One,Talk_Minutes,Intelligent_Minutes,Call_Type,Phone_Label,Recording,Last_Name,First_Name,Street_Address,City,State,Zip_Code,Transfer_To_Number,Call_Transfer_Status,Inbound_Device_Type,URL_Tag,Domain,Search_Term,Activity_Keyword,Custom_Value,Custom_Id,Google_UA_Client_ID,gclid,Campaign,Pool_Name,Location_Name,Keyword,Match_Type,Network,Device,Device_Model,Creative,Placement,Target,Param1,Param2,Random,Ace_Id,Ad_Position,Product_Target_ID,Ad_Type)>
   <!ELEMENT Respondent_ID (#PCDATA)>
   <!ELEMENT Caller_ID (#PCDATA)>
   <!ELEMENT Completed (#PCDATA)>
   <!ELEMENT Timestamp (#PCDATA)>
   <!ELEMENT SID (#PCDATA)>
   <!ELEMENT Question_One (#PCDATA)>
   <!ELEMENT Talk_Minutes (#PCDATA)>
   <!ELEMENT Intelligent_Minutes (#PCDATA)>
   <!ELEMENT Call_Type (#PCDATA)>
   <!ELEMENT Phone_Label (#PCDATA)>
   <!ELEMENT Recording (#PCDATA)>
   <!ELEMENT Last_Name (#PCDATA)>
   <!ELEMENT First_Name (#PCDATA)>
   <!ELEMENT Street_Address (#PCDATA)>
   <!ELEMENT City (#PCDATA)>
   <!ELEMENT State (#PCDATA)>
   <!ELEMENT Zip_Code (#PCDATA)>
   <!ELEMENT Transfer_To_Number (#PCDATA)>
   <!ELEMENT Call_Transfer_Status (#PCDATA)>
   <!ELEMENT Inbound_Device_Type (#PCDATA)>
   <!ELEMENT URL_Tag (#PCDATA)>
   <!ELEMENT Domain (#PCDATA)>
   <!ELEMENT Search_Term (#PCDATA)>
   <!ELEMENT Activity_Keyword (#PCDATA)>
   <!ELEMENT Custom_Value (#PCDATA)>
   <!ELEMENT Custom_Id (#PCDATA)>
   <!ELEMENT Google_UA_Client_ID (#PCDATA)>
   <!ELEMENT gclid (#PCDATA)>
   <!ELEMENT Campaign (#PCDATA)>
   <!ELEMENT Pool_Name (#PCDATA)>
   <!ELEMENT Location_Name (#PCDATA)>
   <!ELEMENT Keyword (#PCDATA)>
   <!ELEMENT Match_Type (#PCDATA)>
   <!ELEMENT Network (#PCDATA)>
   <!ELEMENT Device (#PCDATA)>
   <!ELEMENT Device_Model (#PCDATA)>
   <!ELEMENT Creative (#PCDATA)>
   <!ELEMENT Placement (#PCDATA)>
   <!ELEMENT Target (#PCDATA)>
   <!ELEMENT Param1 (#PCDATA)>
   <!ELEMENT Param2 (#PCDATA)>
   <!ELEMENT Random (#PCDATA)>
   <!ELEMENT Ace_Id (#PCDATA)>
   <!ELEMENT Ad_Position (#PCDATA)>
   <!ELEMENT Product_Target_ID (#PCDATA)>
   <!ELEMENT Ad_Type (#PCDATA)>
]>
<data>
    <record>
        <Respondent_ID>1234567890</Respondent_ID>
        <Caller_ID>5554443333</Caller_ID>
        <Completed>No</Completed>
        <Timestamp>2017-01-01 06:00:00</Timestamp>
        <SID>170101aaabbbcccd</SID>
        <Question_One>user_recordings/555/55555/survey/4444444/1112223334-A1.wav</Question_One>
        <Talk_Minutes>0.5</Talk_Minutes>
        <Intelligent_Minutes>0.4</Intelligent_Minutes>
        <Call_Type>Inbound</Call_Type>
        <Phone_Label>Survey Line</Phone_Label>
        <Recording></Recording>
        <Last_Name>Simpson</Last_Name>
        <First_Name>Homer</First_Name>
        <Street_Address>742 Evergreen Terrace</Street_Address>
        <City>Springfield</City>
        <State></State>
        <Zip_Code></Zip_Code>
        <Transfer_To_Number>5556667890</Transfer_To_Number>
        <Call_Transfer_Status>Answer</Call_Transfer_Status>
        <Inbound_Device_Type>Undetected</Inbound_Device_Type>
        <URL_Tag></URL_Tag>
        <Domain></Domain>
        <Search_Term></Search_Term>
        <Activity_Keyword></Activity_Keyword>
        <Custom_Value></Custom_Value>
        <Custom_Id></Custom_Id>
        <Google_UA_Client_ID></Google_UA_Client_ID>
        <gclid></gclid>
        <Campaign></Campaign>
        <Pool_Name></Pool_Name>
        <Location_Name></Location_Name>
        <Keyword></Keyword>
        <Match_Type></Match_Type>
        <Network></Network>
        <Device></Device>
        <Device_Model></Device_Model>
        <Creative></Creative>
        <Placement></Placement>
        <Target></Target>
        <Param1></Param1>
        <Param2></Param2>
        <Random></Random>
        <Ace_Id></Ace_Id>
        <Ad_Position></Ad_Position>
        <Product_Target_ID></Product_Target_ID>
        <Ad_Type></Ad_Type>
    </record>
    <record>
        <Respondent_ID>0009998887</Respondent_ID>
        <Caller_ID>5554443333</Caller_ID>
        <Completed>Yes</Completed>
        <Timestamp>2017-01-01 06:30:00</Timestamp>
        <SID>170101cccdddeeef</SID>
        <Question_One>user_recordings/555/55555/survey/4444444/9998887776-A1.wav</Question_One>
        <Talk_Minutes>0.7</Talk_Minutes>
        <Intelligent_Minutes>0.2</Intelligent_Minutes>
        <Call_Type>Inbound</Call_Type>
        <Phone_Label>Survey Line</Phone_Label>
        <Recording></Recording>
        <Last_Name>Simpson</Last_Name>
        <First_Name>Homer</First_Name>
        <Street_Address>742 Evergreen Terrace</Street_Address>
        <City>Springfield</City>
        <State></State>
        <Zip_Code></Zip_Code>
        <Transfer_To_Number>5556667890</Transfer_To_Number>
        <Call_Transfer_Status>Answer</Call_Transfer_Status>
        <Inbound_Device_Type>Undetected</Inbound_Device_Type>
        <URL_Tag></URL_Tag>
        <Domain></Domain>
        <Search_Term></Search_Term>
        <Activity_Keyword></Activity_Keyword>
        <Custom_Value></Custom_Value>
        <Custom_Id></Custom_Id>
        <Google_UA_Client_ID></Google_UA_Client_ID>
        <gclid></gclid>
        <Campaign></Campaign>
        <Pool_Name></Pool_Name>
        <Location_Name></Location_Name>
        <Keyword></Keyword>
        <Match_Type></Match_Type>
        <Network></Network>
        <Device></Device>
        <Device_Model></Device_Model>
        <Creative></Creative>
        <Placement></Placement>
        <Target></Target>
        <Param1></Param1>
        <Param2></Param2>
        <Random></Random>
        <Ace_Id></Ace_Id>
        <Ad_Position></Ad_Position>
        <Product_Target_ID></Product_Target_ID>
        <Ad_Type></Ad_Type>
    </record>
</data>
"Respondent_ID","Caller_ID","Completed","Timestamp","SID","Question_One","Talk_Minutes","Intelligent_Minutes","Call_Type","Phone_Label","Recording","Last_Name","First_Name","Street_Address","City","State","Zip_Code","Transfer_To_Number","Call_Transfer_Status","Inbound_Device_Type","URL_Tag","Domain","Search_Term","Activity_Keyword","Custom_Value","Custom_Id","Google_UA_Client_ID","gclid","Campaign","Pool_Name","Location_Name","Keyword","Match_Type","Network","Device","Device_Model","Creative","Placement","Target","Param1","Param2","Random","Ace_Id","Ad_Position","Product_Target_ID","Ad_Type"
"1234567890","5554443333","No","2017-01-01 06:00:00","170101aaabbbcccd","user_recordings/555/55555/survey/4444444/1112223334-A1.wav","0.5","0.4","Inbound","Survey Line","","Simpson","Homer","742 Evergreen Terrace","Springfield","","","5556667890","Answer","Undetected","","","","","","","","","","","","","","","","","","","","","","","","","",""
"0009998887","5554443333","Yes","2017-01-01 06:30:00","170101cccdddeeef","user_recordings/555/55555/survey/4444444/9998887776-A1.wav","0.7","0.2","Inbound","Survey Line","","Simpson","Homer","742 Evergreen Terrace","Springfield","","","5556667890","Answer","Undetected","","","","","","","","","","","","","","","","","","","","","","","","","",""

Response Appendix

This is a list of each value returned by the IVR Report API and a simple description of what that value represents.

Parameter
Description

Respondent_ID

A unique ID assigned to the respondent

Caller_ID

Caller ID of the respondent

Completed

A Yes/No flag if the IVR was completed normally. No indicates the respondent likely hung up during the IVR

Timestamp

Response time of the Respondent

SID

A unique identifier for the call on the DialogTech system

The include_cdr and include_st parameters

Additional fields are returned when include_cdr is selected. Those fields are

  • Talk_Minutes
  • Intelligent_Minutes
  • Call_Type
  • Phone_Label
  • Recording
  • Last_Name
  • First_Name
  • Street_Address
  • City
  • State
  • Zip_Code
  • Transfer_To_Number
  • Call_Transfer_Status
  • Inbound_Device_Type

Additional fields are returned when include_st is utilized. Those fields are

  • URL_Tag
  • Domain
  • Search_Term
  • Activity_Keyword
  • Custom_Value
  • Custom_Id
  • Google_UA_Client_ID
  • gclid
  • Campaign
  • Pool_Name
  • Location_Name
  • Keyword
  • Match_Type
  • Network
  • Device
  • Device_Model
  • Creative
  • Placement
  • Target
  • Param1
  • Param2
  • Random
  • Ace_Id
  • Ad_Position
  • Product_Target_ID
  • Ad_Type

The definitions of all these fields can be found within the Call Detail Report API documentation.