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

  1. Get a random string through the API endpoint /api/v1.1.0/cdr/get_random?token={token}.
  2. 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/v1.1.0/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
POST /api/v1.1.0/cdr/get_random?token=1e3b3ebb6a974cb42ed31de5413df52d HTTP/1.1
Content-Type:application/json; charset=utf-8
Host: api.yeastarcloud.com
{
    "extid": "all",
    "starttime": "2018-11-07 00:00:00",
    "endtime": "2019-02-18 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": "2018-11-07 00:00:00",
    "endtime": "2019-02-18 23:59:59",
    "random": "0cbcf8917c41c61c6e9fd3e57ecdd467"
}

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:

https://{pbx domain}/api/v1.1.0/cdr/download?extid={extid}&starttime={starttime}&endtime={endtime}&token={token}&random={random}

Download link example:

https://yeastarcloudpbx.com/api/v1.1.0/api/v1.1.0/cdr/download?extid=all&starttime=2018-11-27 00:00:00&endtime=2019-02-18 23:59:59&token=48400f35207bb9c330a0bdaf4a5633e2&random=0cbcf8917c41c61c6e9fd3e57ecdd467