Download a Scheduled Call Report

Download a specific scheduled call report.

Steps to download a scheduled call report

Request URL

GET {base_url}/{api_path}/call_schedule_report/download?access_token={access_token}
Note: To enhance system performance, Yeastar has upgraded the CDR module in version 84.21.0.117 with a new data structure for clearer display and more comprehensive call details. The system gradually deletes old CDRs and related call report data according to the CDR Auto Cleanup setting.

Before old call report data are cleaned up, new and historical data are managed separately - openapi/v2.0 for new data and openapi/v1.0 for historical data. Make sure to use the appropriate API path based on the type of data that you want to retrieve.

Request parameters

Parameter Available Required Type Description
id This parameter is available in all call report types. Yes Integer The unique ID of the scheduled call report.
Note: You can query the call report's ID using Query Scheduled Call Report List.
need_detail This parameter is available when querying the following types of reports:
  • IVR Report
  • Queue Performance
  • Queue Performance Activity
  • Agent Performance
No Integer Whether to include details about the associated calls.
Valid value:
  • 0: Exclude the call details.
  • 1: Include the call details.
is_async This parameter is available in all call report types. No Integer

Whether to retrieve data and obtain the download URL of call report asynchronously.

Valid value:
  • 0: Synchronously.
  • 1: Asynchronously.
    Note: When data is retrieved and the download URL of call report is generated, the PBX will send event report 30027 to the third-party application.

Response parameters

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.
  • If you choose to retrieve data asynchronously, error code 2 and error message PROCESSING will be returned. When data is retrieved and the download URL of call report is generated, the PBX will send event report 30027 to the third-party application.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
file String The scheduled call report.
download_resource_url String The scheduled call report download URL.
Note: The download URL is only valid for 30 minutes.

Examples

Request Example

Important: Make sure to use the appropriate API path based on the type of report data that you want to retrieve.
  • For new report data generated on version 84.21.0.117 or later, use openapi/v2.0.
  • For legacy report data generated on version 84.21.0.66 or earlier, use openapi/v1.0.
GET /openapi/v1.0/call_schedule_report/download?id=5&access_token=FZCqUJucsaaUYikWHJA7sCEBjo0z8k5C HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com

Response Example

 HTTP/1.1 200 OK
{
  "errcode": 0,
  "errmsg": "SUCCESS",
  "file": "Support.csv",
   "download_resource_url": "/api/download/Support.csv"
 }

Download the scheduled call report

After obtaining the download URL for the call report, combine it with the {base_url} and append the {access_token} parameter. Then, use the complete link to download the call reports.

Download link format

{base_url}/{download_resource_url}?access_token={access_token}

Download link example

https://yeastardocs.example.yeastarcloud.com/api/download/Support.csv?access_token=WQMR0cuirhX264oZMa9pV03T9li924NS