Download CDR Files
Get a random string of the CDR file, then combine the random string with other parameters to form a download link.
Step to download a CDR file
Get a random string through the 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.
Endpoint
POST /api/v0.0.1/cdr/get_random?token={token}
Request Parameters
Name | Importance | Type | Description |
extid | Required | String | Specify which extensions’ CDR to download.
All extensions: Set extid to all. An extension: Set extid to the extension number. Multiple extensions: Set extid to the extension number. Separate multiple extensions with ,. Example: “extid”: “1000,1001,1002” |
starttime | Required | String | Specify the start time to filter the CDR reports.
Time format: yyyy-mm-dd hh:mm:ss |
endtime | Required | String | Specify the end time to filter the CDR reports.
Time format: yyyy-mm-dd hh:mm:ss |
allowedip | Optional | String | Specify the allowed IP address to download the file.
No allowedip parameter: Only the 3rd party application can download the file. If allowedip is set, the allowed IP address and the 3rd party application can download the file. Note: The allowedip only supports one IP address. |
Response Parameters
Name | Type | Description |
extid | 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 created for downloading CDR file. The random string is a component of the CDR download link. |
Examples
Request Example
Get the random code of the call records of all extensions.
POST /api/v0.0.1/cdr/get_random?token=813b621cfe8eecf445a2ce1f4a079ffe HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: 172.16.6.150
{
“extid”: “all”,
“starttime”: “2020-05-18 00:00:00”,
“endtime”: “2020-05-20 23:59:59
}
Response Example
HTTP/1.1 200 OK
Access-control-allow-origin: *
Access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE
{
“status”: “Success”,
“extid”: “all”,
“starttime”: “2020-05-01 00:00:00”,
“endtime”: “2020-05-05 23:59:59”,
“random”: “9ec0ef42229c68406363d21e8a82ca31”
}
CDR Download Link
Use the API responded random string as a component of a specific request address for downloading the CDR file. The CDR file is in CSV format. Check the descriptions of CDR parameters.
CDR download link format:
http://{pbx ip}:{https port}/api/v0.0.1/cdr/download?extid={extid}&starttime={starttime}&endtime={endtime}&token={token}&random={random}
Download link example: