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
Note: To perform a fuzzy search for the phone number, you can
enable the fuzzy search feature using the Edit CDR Options
interface.
| Parameter | Required | Type | Description |
|---|---|---|---|
| start_time | No | String | Specify the start time to filter CDR. Note:
|
| end_time | No | String | Specify the end time to filter CDR. Note:
|
| 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. |
| disposition_code_list | No | String | The ID(s) of the call disposition code(s) of call notes. Note:
|
| call_note_remark | No | String | The remark of call notes. |
| status | No | String | call status. Valid value:
|
| did | No | String | Specify the DID to filter the CDR. Valid value: {did_number}:{trunk_name} or {did_name}:{trunk_name} Note:
|
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 obtaining the download URL for the CDR file, combine it with the {base_url} and append the
{access_token} parameter. Then, use the complete link to
download the desired file.
Download link format
{base_url}/{download_resource_url}?access_token={access_token}
Download link example
https://192.168.5.150:8088/api/download/Cdr-X.7.0.16-download-20220520093856-xdhICiIeubqMAtvP.csv?access_token=5tQstKGzg0Lt4MGTETC1eDjlzk97IIny