Download CDR Files
Download CDR files of specific extensions or all extensions.
Steps to download a CDR file
- Get the random string of CDR file.
- Combine the random string with other parameters to form a download
link.Note: The random string is only valid for 30 seconds, and each random string can be used only once.
Request URL
{base_url}/{api_path}/cdr/get_random?token={token}
Request parameters
Parameter | Required | Type | Description |
---|---|---|---|
number | Yes | String | Extension number, which means which extension's CDR file will
be downloaded. Valid values:
|
starttime | Yes | String | Specify the start time to filter the CDR reports. Time
format: |
endtime | Yes | String | Specify the end time to filter the CDR reports. Time
format: |
allowedip | No | String |
Specify the IP address which is allowed to download CDR file.
By default, Valid values:
|
Response parameters
Parameter | Type | Description |
---|---|---|
status | String | Request result.
|
number | String | Extension number. |
starttime | String | The start time to filter the CDR reports. |
endtime | String | The end time to filter the CDR reports. |
random | String | A random string for CDR file. Combine the random string with other parameters to form a download link. |
Examples
Request exampleGet the random string of CDR file for extension 4000.
POST /api/v2.0.0/cdr/get_random?token=1e3b3ebb6a974cb42ed31de5413df52d Content-Type:application/json; charset=utf-8 Host: 192.168.5.150 { "number": "4000", "starttime": "2019-10-24 00:00:00", "endtime": "2019-10-24 15:59:59" }
HTTP/1.1 200 OK Server: Boa/0.94.14rc21 Accept-Ranges: bytes Connection: close Content-Type: application/json Access-control-allow-origin: * Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE { "status": "Success", "number": "4000", "starttime": "2019-10-24 00:00:00", "endtime": "2019-10-24 15:59:59", "random": "7b5a748e176d1ed625793d3a231808dc" }
Download Link Example
Use the API responded random as a component of a specified request address for downloading the CDR file.The CDR file is in CSV format. Check the descriptions of CDR parameters.
https://{pbx ip}:{https port}/api/v2.0.0/cdr/download?number={number}&starttime={starttime}&endtime={endtime}&token={token}&random={random}
https://192.168.5.150:8088/api/v2.0.0/cdr/download?number=4000&starttime=2019-10-24%2000:00:00&endtime=2019-10-24%2015:59:59&token=4555b319609ca31410f7b946671fcc69&random=7b0ad48124d720235b05d2435a48bc30