Download a CDR File
Download a CDR file of specific extensions or all extensions.
Steps to download a CDR file
Request URL
GET {base_url}/{api_path}/cdr/download?access_token={access_token}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
start_time | No | String | Specify the start time to filter CDR. Note: The time format depends on the
date and time display format of PBX (set in on PBX).
Examples:
|
end_time | No | String | Specify the end time to filter CDR. Note: The time format depends on the
date and time display format of PBX (set in on PBX).
Examples:
|
call_from | No | String | The number of caller. |
call_to | No | String | The number of callee. |
extension_group | No | Integer | The unique ID of the an extension group. Note: You can query the extension group's ID
using Get Menu Options. |
status | No | String | call status. Valid value:
|
enable_fuzzy_search | No | String | Whether
to search for the fuzzy equivalent for the phone
number. Valid value:
|
Response parameters
Parameter | Type | Description |
---|---|---|
errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
errmsg | String | Returned message.
|
file | String | The CDR file. |
download_resource_url | String | The CDR download URL. Note: The download
URL is only valid for 30 minutes. |
Examples
Request example
Obtain the download URL of the CDR during 05/19/2022 00:00:00-05/19/2022 23:59:59.
Important: If you want to filter CDR by date and
time, the format of
start_time
and end_time
MUST follow
the date and time display format of your PBX, otherwise the response
will not return any CDR records.GET /openapi/v1.0/cdr/download?access_token=5tQstKGzg0Lt4MGTETC1eDjlzk97IIny&start_time=05/19/2022 00:00:00&end_time=05/19/2022 23:59:59 HTTP/1.1
192.168.5.150:8088
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"file": "Cdr-X.7.0.16-download-20220520093856-xdhICiIeubqMAtvP.csv",
"download_resource_url": "/api/download/Cdr-X.7.0.16-download-20220520093856-xdhICiIeubqMAtvP.csv"
}
Download the CDR file
After you get the download URL, you need to combine the download URL with the {base_url} to compose a download request, and then send the request to download the CDR file.
Download link format
GET {base_url}/{download_resource_url}
?access_token={access_token}
Download link example
GET https://192.168.5.150:8088/api/download/Cdr-X.7.0.16-download-20220520093856-xdhICiIeubqMAtvP.csv?access_token=5tQstKGzg0Lt4MGTETC1eDjlzk97IIny