Call Logs
View historical logs
This method allows you to access historical logs. Only calls that have already been processed for billing will be returned via this method.
URL
/api/v2/logs/historical
Supported Parameters
page- the page number you wish to view (defaults to 1)type- the type of logs to display (external,incomingorall)uuid- the UUID of the call
Example JSON
Outgoing Call
{ "status": "success", "time": 0.24, "flags": { "current_page": 1, "items_per_page": 25, "total_pages": 1, "total_records": 2, "paginated": { "page": 1, "per_page": 25, "total_pages": 1, "total_records": 2 } }, "data": [ { "id": 5, "timestamp": "2015-08-25T17:05:28.000Z", "duration": 4, "source": { "id": "101", "name": "Reception Phone" }, "destination": { "id": "peer1", "name": "03031237300", "type": null }, "call_type": "outgoing", "cost": null, "status": "ANSWERED", "has_recording?": false } ] }
Incoming Call
{ "status":"success", "time":0.03, "flags": { "current_page": 1, "items_per_page": 25, "total_pages": 1, "total_records": 2, "paginated": { "page": 1, "per_page": 25, "total_pages": 1, "total_records": 2 } }, "data":[ { "id":3600476, "UUID":"2f5e6694-7fb9-401e-ac92-3f9e6941beec", "timestamp":"2015-12-22T11:46:05.000Z", "duration":8, "source": { "id":"03031237300", "name":"03031237300" }, "destination": { "id":"03301222970", "name":"03301222970", "type":null }, "call_type":"incoming", "cost":"0.0", "status":"ANSWERED", "has_recording?":false } ] }
Download recording
This method allows you to download a recording
URL
/api/v2/logs/recording
Supported Parameters
id- The ID of the recording to return
Example JSON
{ "status": "success", "time": 3.2, "flags": {}, "data": { "type": "audio/x-wav", "file": "BASE64 encoded file", "filename": "Recording-19.wav" } }
Delete recording
This method allows you to delete a call recording
URL
/api/v2/logs/delete_recording
Supported Parameters
id- The ID of the recording to remove
Example Response
true
Active calls
This method allows you to view active calls within your unit.
URL
/api/v2/logs/active
Supported Parameters
There are no supported parameters for this method.
Example JSON
{ "status":"success", "time":0.07, "flags":{}, "data": [ { "call_type":"outgoing", "duration":"00:00:18", "state":"Connected", "from": { "type":"Extension", "object": { "id":2902, "name":"alex", "exten":"100" } }, "to": { "type":"String", "object":"44700123456" } } ] }
Search call logs
This method allows you to search historical logs. Only calls that have already been processed for billing will be returned via this method.
URL
/api/v2/logs/search
Supported Parameters
call_type- The type of call to search for, eitherall,incomingoroutgoing(required, defaults toall)call_status- The status of the calls, eitherall,answeredornot_answered- defaults toallsource- The source number to search fordestination- The destination number to search forextension- The username of id of the extension to find calls forstart_at- When to search fromend_atWhen to search topage- The page of the log, defaults to 1
Example JSON
{ "status":"success", "time":0.02, "flags":{ "paginated":{ "page":1, "per_page":null, "total_pages":1, "total_records":3 } }, "data":[{ "id":3629144, "UUID":"2f5e6694-7fb9-401e-ac92-3f9e6941beec", "timestamp":"2016-01-06T18:52:31.000Z", "duration":4, "source":{ "id":"01234567890", "name":"01234567890", "type":null }, "destination":{ "id":"03301222970", "name":"03301222970", "type":"Number" }, "call_type":"incoming", "cost":"0.0", "status":"ANSWERED", "has_recording?":false, "source_channel_extension":null, "destination_channel_extension":null }, { "id":3621218, "UUID":"2f5e6694-7fb9-401e-ac92-3f9e6941abcd", "timestamp":"2016-01-05T12:00:25.000Z", "duration":6, "source":{ "id":"100", "name":"test", "type":"Extension" }, "destination":{ "id":"01234567890", "name":"01234567890", "type":null }, "call_type":"outgoing", "cost":null, "status":"NO ANSWER", "has_recording?":false, "source_channel_extension":null, "destination_channel_extension":null }, { "id":3621199, "UUID":"2f5e6694-7fb9-401e-ac92-3f9e6941dcba", "timestamp":"2016-01-05T11:58:54.000Z", "duration":1, "source":{ "id":"100", "name":"test", "type":"Extension" }, "destination":{ "id":"01234567890", "name":"Alex", "type":"AddressContact" }, "call_type": "outgoing", "cost":null, "status":"NO ANSWER", "has_recording?":false, "source_channel_extension":null, "destination_channel_extension":null }] }
Call stats
This method allows you retrieve call statistics for the current day.
URL
/api/v2/logs/call_stats
Supported Parameters
date- a specific date to retrieve statistics for (defaults to today's date).
Example JSON
{ "status":"success", "time":0.15, "flags":{}, "data":{ "total":{ "calls":3, "duration":8 }, "incoming":{ "all":{ "calls":2, "duration":5 }, "answered":{ "calls":2, "duration":5 }, "unanswered":{ "calls":0,"duration":0 } }, "outgoing":{ "all":{ "calls":1, "duration":3 }, "answered":{ "calls":1, "duration":3 }, "unanswered":{ "calls":0, "duration":0 } }, "extensions":{ "100":{ "details":{ "name":"Jonathan" }, "incoming":{ "all":{ "calls":0, "duration":0 }, "answered":{ "calls":0, "duration":0 }, "unanswered":{ "calls":0, "duration":0 } }, "outgoing":{ "all":{ "calls":0, "duration":0 }, "answered":{ "calls":0, "duration":0 }, "unanswered":{ "calls":0, "duration":0 } } }, "102":{ "details":{ "name":"Alex" }, "incoming":{ "all":{ "calls":2, "duration":5 }, "answered":{ "calls":2, "duration":5 }, "unanswered":{ "calls":0, "duration":0 } }, "outgoing":{ "all":{ "calls":1, "duration":3 }, "answered":{ "calls":1, "duration":3 }, "unanswered":{ "calls":0, "duration":0 } } } } } }