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

Table 1.
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 System > Date and Time > Display Format on PBX).

Examples:

  • If the display format is Month/Day/Year and is 24-hours format, then the valid time format is MM/DD/YYYY HH:mm:ss.
  • If the display format is Year/Month/Day and is 12-hours format, then the valid time format is YYYY/MM/DD HH:mm:ss AM or YYYY/MM/DD HH:mm:ss PM.
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 System > Date and Time > Display Format on PBX).

Examples:

  • If the display format is Month/Day/Year and is 24-hours format, then the valid time format is MM/DD/YYYY HH:mm:ss.
  • If the display format is Year/Month/Day and is 12-hours format, then the valid time format is YYYY/MM/DD HH:mm:ss AM or YYYY/MM/DD HH:mm:ss PM.
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:
  • ANSWERED
  • NO ANSWER
  • BUSY
  • FAILED
  • VOICEMAIL
enable_fuzzy_search No String Whether to search for the fuzzy equivalent for the phone number.

Valid value:

  • 0: Disable
  • 1: Enable

Response parameters

Table 2.
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
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