getCallMetrics¶
Request Method: GET
Description: Retrieves a metric breakdown of calls
URL: https://api.iovox.com:444/Calls?v=3&method=getCallMetrics
The following parameters can be sent in the querystring
Parameter | Description | Default Value | Data Type | Mandatory |
v | API version to use | INTEGER | YES | |
page | The page number to return. Use together with limit to achieve paginated results | 1 | INTEGER | NO |
limit | Determines how many results to return. Use together with page to achieve paginated results. Maximum here is 20000 | 20000 | INTEGER | NO |
sdt | Returns all calls since a given date. Start date format is YYYY-MM-DD HH:MM:SS with hours, minutes and seconds being optional. Hours, minutes and seconds defaults to 00:00:00 | 1st day of current month at 00:00:00 | DATETIME | NO |
edt | Returns all calls before a given date. End date format is YYYY-MM-DD HH:MM:SS with hours, minutes and seconds being optional. Hours, minutes and seconds defaults to 23:59:59 | Current day at 23:59:59 | DATETIME | NO |
node_id | Returns all calls for the specified Node ID | STRING | NO | |
node_type | Returns all calls for the specified Node Type | STRING | NO | |
link_id | Returns all calls for the specified Link ID | STRING | NO | |
link_type | Returns all calls for the specified Link Type | STRING | NO | |
call_res | Returns all data under the given call result, e.g. ANSWERED | STRING | NO | |
rule_res | Returns all data under the given rule result, e.g. Call to an Operator | STRING | NO | |
call_origin | Returns all data under the given call origin, e.g. 447966111222 | STRING | NO | |
call_origin_encryption | Returns all data under the given call origin encrypted, e.g. 4478_516CD74E0509B222 | STRING | NO | |
voxnumber | Returns all data under the given VoxNumber, e.g. 448456111222 | INTEGER | NO | |
call_dest | Returns all data under the given call destination, e.g. 447966123456 | STRING | NO | |
ctype | Returns all data under the given call type, e.g. DIRECT or API | STRING | NO | |
detail | Returns all data for the given detail. This includes IP Address (for makeTwoWayCall) and conference room number | STRING | NO | |
cat_ids | Returns all data for the given category IDs. To produce an AND based search separate each by a comma and to produce an OR based, separate as array elements. For example, cat_ids[]=1,2&cat_ids[]=3,4 would search where category ID is (1 AND 2) OR (3 AND 4). Note: if a search is made for Category ID 5, potentially Location = London, results will include any items further down the tree, such as Notting Hill | ARRAY | NO | |
req_fields | Comma separated list of abbreviated metrics to return in response. tc=Total Calls, acpd=Average Calls Per Day, tct=Formatted Total Call Time (00:00:00), tcts=Total Call Time in Seconds, act=Formatted Average all Time (00:00:00), acts=Average Call Time in seconds, ttt=Formatted Total Talk Time (00:00:00), ttts=Total Talk Time in Seconds, att=Formatted Average Talk Time (00:00:00), atts=Average Talk Time in Seconds, tuc=Total Unique Callers, tun=Total Unique Nodes, tul=Total Unique Links | tc,ttt,att,tuc,tun,tul | STRING | NO |
group_fields | Comma separated abbreviations of up to 2 fields to group the result set by. These will be appended to the req_fields list. cdate = Call Date, cweekd=Call Weekday, cmonth=Month of Call, co=Call Origin, coe=Call Origin Encrypted , vn=VoxNumber, cd=Call Destination, detail=IP Address/Conference ID, call_res=Call Result, nid=Node ID, ntype=Node Type, lid=Link ID, lname=Link Name, ltype=Link Type | STRING | NO | |
output | Specifying XML or JSON returns data in XML or JSON format | XML | STRING | NO |
Result¶
Error Result¶
HTTP Code | Error String | Resolution |
400 | API Version Empty | Add a value for the v parameter in the query string |
400 | API Version Invalid | Correct v parameter |
400 | Request Method must be GET. x attempted | Switch request method x to GET |
400 | Page Number not an integer | Remove non-numerics from page |
400 | Limit not an integer | Remove non-numerics from limit |
400 | Limit must be between 1 and 20000 | Correct the limit |
400 | Start Date Invalid | Correct sdt parameter |
400 | End Date Invalid | Correct edt parameter |
400 | Voxnumber not an integer | Correct Voxnumber |
400 | Required Fields Invalid: fieldone,fieldtwo | Correct or remove fieldone and fieldtwo |
400 | Group Fields Invalid: groupone,grouptwo | Correct or remove groupone and grouptwo |
400 | Output Type Invalid | Correct output parameter |
500 | Internal Server Error | Retry later |
Success Result¶
Example 1: Full list of metrics for each Node, broken down further into Call Result:
https://api.iovox.com:444/Calls?v=2&method=getCallMetrics&req_fields=tc,acpd,tuc,tun,tul&group_fields=nid,call_res
<?xml version="1.0" encoding="utf-8"?>
<response>
<current_page>1<current_page>
<total_pages>4<total_pages>
<total_results>350<total_results>
<results>
<result>
<call_result>ANSWERED</call_result>
<total_calls>100</total_calls>
<ave_calls_per_day>12</ave_calls_per_day>
<total_call_time>08:20:00</total_call_time>
<total_call_time_sec>30000</total_call_time_sec>
<ave_call_time>00:05:00</avg_call_time>
<ave_call_time_sec>300</avg_call_time_sec>
<total_talk_time>06:40:00</total_talk_time>
<total_talk_time_sec>24000</total_talk_time_sec>
<ave_talk_time>00:04:00</avg_talk_time>
<ave_talk_time_sec>240</avg_talk_time_sec>
<total_unique_callers>20</total_unique_callers>
<total_unique_nodes>80</total_unique_nodes>
<total_unique_links>76</total_unique_links>
</result>
<result>
...
<result>
</results>
</response>
Example 2: Comparison of calls to each Link Type:
https://api.iovox.com:444/Calls?v=2&method=getCallMetrics&req_fields=tc,acpd&group_fields=ltype
<?xml version="1.0" encoding="utf-8"?>
<response>
<current_page>1<current_page>
<total_pages>4<total_pages>
<total_results>350<total_results>
<results>
<result>
<link_type>Street Sign</link_type>
<total_calls>20</total_calls>
<ave_calls_per_day>1</ave_calls_per_day>
</result>
<result>
<link_type>Magazine Advertisement</link_type>
<total_calls>200</total_calls>
<ave_calls_per_day>10</ave_calls_per_day>
</result>
<result>
<link_type>Web Advertisement</link_type>
<total_calls>500</total_calls>
<ave_calls_per_day>25</ave_calls_per_day>
</result>
</results>
</response>