HTTP API cdr¶
- Table of contents
- HTTP API cdr
Returns a list of CDRs by account
Required arguments¶
argument | description |
_login | coincides with the user / company login to the personal account |
_password | matches the user / company password to the personal account |
date_from | UTC time (number of seconds from 1970-01-01 00:00:00) |
date_to | UTC time (number of seconds from 1970-01-01 00:00:00) |
Optional arguments¶
argument | description |
with_unanswered | 1 - return unanswered, 0 - do not return unanswered (default 0) |
with_sessionid | 1 - return the session ID attribute, 0 - do not return the session ID attribute (default 0) |
with_channelid | 1 - return the channel ID attribute, 0 - do not return the channel ID attribute (default 0) |
with_direction | 1 - return the "call direction" attribute, 0 - do not return the "call direction" attribute (0 by default) |
with_hangupcause | 1 - return the "release code" attribute, 0 - do not return the "release code" attribute (0 by default) |
Returned data¶
status | "ok", if the operation completed without an error, "error", if an error occurred, or if it was not possible to return useful data |
data | useful data, returned when status = "ok" |
errors | error details, returned when status = "error" |
calldate | UTC call start time (number of seconds from 1970-01-01 00:00:00) |
src | caller number |
dst | dialed number |
duration | total call duration |
billsec | answered call duration |
uniqueid | unique call ID, matches uniqueid from active_calls and recordings |
channelid | unique leg ID |
sessionid | unique session ID, a session can contain several legs |
direction | call direction relative to Smartswitch, "inbound" - the call comes from the user in Smartswitch, "outbound" - the call comes from Smartswitch to the user |
hangupcause | Q.931 call termination code (see End Codes Q.931) |
Example¶
request | GET "https://your.server.name/api/cdr?date_from=1539621667&date_to=1539631667&_login=LOGIN&_password=PASSWORD" |
answer | { "data": [ { "calldate": "1539621667", "src": "100", "dst": "12123388100", "duration": "30", "billsec": "10", "uniqueid": "1539621667.443" }, { "calldate": "1539621668", "src": "100", "dst": "12123388101", "duration": "60", "billsec": "50", "uniqueid": "1539621668.444" } ], "status": "ok" } |