Download a Call Report

Download a specific call report.

Steps to download a call report

Request URL

GET {base_url}/{api_path}/call_report/download?access_token={access_token}

Request parameters

Table 1.
Parameter Available Required Type Description
type This parameter is available in all call report types. Yes String Call report type.
Valid value:
  • extcallstatistics: Extension Call Statistics report.
  • extcallactivity: Extension Call Activity report.
  • trunkactivity: PBX Call Activity report.
  • trunkdiddodactivity: DID/Outbound Caller ID Activity report.
  • ivr: IVR Report.
  • queueavgwaittalktime: Queue AVG Waiting & Talking Time report.
  • queueperformance: Queue Performance report.
  • queueperformanceactivity: Queue Performance Activity report.
  • queuecallbackssummary: Queue Callback Summary report.
  • queuecallbacksactivity: Queue Callback Activity report.
  • queuesatisfaction: Satisfaction Survey report.
  • queuesatisfactiondetail: Queue Satisfaction Survey Details report.
  • queueagentlogintime: Agent Login Activity report.
  • queueagentpausetime: Agent Pause Activity report.
  • queueagentmisscalls: Agent Missed Call Activity report.
  • queueagentperformance: Agent Performance report.
  • queueagentinoutcalls: Agent Call Summary report.
  • ringgroupstatistics: Ring Group Statistics report.
  • extcallbilling: Extension Call Accounting report.
  • extcallbillingdetails: Extension Call Accounting Details report.
start_time This parameter is available when querying the following types of reports.
  • Extension Call Statistics
  • IVR Report
  • Queue Performance
  • Queue Callback Summary
  • Queue Callback Activity
  • Satisfaction Survey
  • Satisfaction Survey Details
  • Agent Login Activity
  • Agent Pause Activity
  • Agent Missed Call Activity
  • Agent Performance
  • Agent Call Summary
  • Ring Group Statistics
  • Extension Call Accounting
  • Extension Call Accounting Details
No String Specify the start time to filter the reports.
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 This parameter is available when querying the following types of reports.
  • Extension Call Statistics
  • IVR Report
  • Queue Performance
  • Queue Callback Summary
  • Queue Callback Activity
  • Satisfaction Survey
  • Satisfaction Survey Details
  • Agent Login Activity
  • Agent Pause Activity
  • Agent Missed Call Activity
  • Agent Performance
  • Agent Call Summary
  • Ring Group Statistics
  • Extension Call Accounting
  • Extension Call Accounting Details
No String Specify the end time to filter the reports.
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.
time This parameter is available when querying the following types of reports:
  • Extension Call Activity
  • PBX Call Activity
  • DID/Outbound Caller ID Activity
  • Queue AVG Waiting & Talking Time
  • Queue Performance Activity
Yes String

Specify the time frame to filter the call report.

Note: The time format depends on the date display format of PBX.

For example, Date Display Format of PBX is Year/Month/Day, then the valid time format is YYYY/MM/DD.

Time format:
  • To query the reports by hour, enter YYYY/MM/DD.
  • To query the reports by day, enter YYYY/MM.
  • To query the reports by month, enter YYYY.
ext_id_list This parameter is available when querying the following types of reports:
  • Extension Call Statistics
  • Extension Call Activity
  • Extension Call Accounting
  • Extension Call Accounting Details
This parameter is required when querying the following types of reports:
  • Extension Call Statistics
  • Extension Call Activity
String The ID(s) of the desired extension(s)/extension group(s).
Note:
  • You can query the extension/extension group's ID using Get Menu Options.
  • Use a comma to separate multiple IDs.
trunk_id This parameter is available when querying 'DID/Outbound Caller ID Activity' report. Yes String The ID of the desired trunk.
Note: You can query the trunk's ID using Get Menu Options.
trunk_id_list This parameter is available when querying the following types of reports:
  • PBX Call Activity
  • Extension Call Accounting
  • Extension Call Accounting Details
Yes String The ID(s) of the desired trunk(s).
Note:
  • You can query the trunk's ID using Get Menu Options.
  • Use a comma to separate multiple IDs.
ivr_id_list This parameter is available when querying IVR Report. Yes String The ID(s) of the desired IVR(s).
Note:
  • You can query the IVR's ID using Get Menu Options.
  • Use a comma to separate multiple IDs.
ring_group_id_list This parameter is available when querying 'Ring Group Statistics' report. Yes String The ID(s) of the desired ring group(s).
Note:
  • You can query the ring group's ID using Get Menu Options.
  • Use a comma to separate multiple IDs.
queue_id This parameter is available when querying the following types of reports:
  • Satisfaction Survey
  • Satisfaction Survey Details
  • Agent Login Activity
  • Agent Pause Activity
  • Agent Missed Call Activity
  • Agent Performance
  • Agent Call Summary
Yes String The ID of the desired queue.
Note: You can query the queue's ID using Get Menu Options.
queue_id_list This parameter is available when querying the following types of reports:
  • Queue AVG Waiting & Talking Time
  • Queue Performance
  • Queue Performance Activity
  • Queue Callback Summary
  • Queue Callback Activity
Yes String The ID(s) of the desired queue(s).
Note:
  • You can query the queue's ID using Get Menu Options.
  • Use a comma to separate multiple IDs.
agent_id_list This parameter is available when querying the following types of reports:
  • Satisfaction Survey Details
  • Agent Login Activity
  • Agent Pause Activity
  • Agent Missed Call Activity
  • Agent Performance
  • Agent Call Summary
No String The ID(s) of the desired agent(s).
Note:
  • You can query the agent's ID using Get Menu Options.
  • Use a comma to separate multiple IDs.
abandon_time This parameter is available when querying the following types of reports:
  • Queue Performance
  • Queue Performance Activity
  • Agent Missed Call Activity
  • Agent Performance
No String Set a time. Calls abandoned within the specified time will not be included in report. (Unit: Second)
talk_time This parameter is available when querying Queue Performance report. No Integer Set a time. Calls that proceeded within the specified time will be not be included in report. (Unit: Second)
include_internal This parameter is available when querying PBX Call Activity report. No Integer Whether to include internal calls in the report.
Valid value:
  • 0: Exclude the internal calls.
  • 1: Include the internal calls.
callback_result This parameter is available when querying Queue Callback Activity report. No String Queue callback result.

Valid value:

  • success
  • fail
reason This parameter is available when querying Agent Pause Activity report. No String The reason why an agent switched status to pause.

Valid value: The pause reasons set on PBX web portal (Path: Call Features > Queue > Pause Reason).

communication_type This parameter is available when querying the following types of reports:
  • Extension Call Statistics
  • Extension Call Activity
  • PBX Call Activity
  • DID/Outbound Caller ID Activity
No String Communication type.
Note: If this parameter is omitted, the system will query all the communication types.
Valid value for extension related reports:
  • Inbound
  • Outbound
  • Internal
Valid value for trunk related reports:
  • Inbound
  • Outbound

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 call report file.
download_resource_url String The call report download URL.
Note: The download URL is only valid for 30 minutes.

Examples

Request example

Obtain the download URL of the queue satisfaction survey report (queue ID: "1") during 04/01/2022 00:00:00-05/31/2022 23:59:59.

Important: If you want to filter call reports 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 records.
GET /openapi/v1.0/call_report/download?type=queuesatisfaction&start_time=04/01/2022 00:00:00&end_time=05/31/2022 23:59:59&queue_id=1&access_token=MB1OklPar5hnDfhi4srZa8FrZ4znFSzr HTTP/1.1  

Host: yeastardocs.example.yeastarcloud.com

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "file": "QueueSatisfaction-X.7.0.7-download-20220608094753-ejP6Z6htIfhsCQbP.csv",
    "download_resource_url": "/api/download/QueueSatisfaction-x.7.0.7-download-20220608094753-ejP6Z6htIfhsCQbP.csv"
}

Download the call report

After you get the download URL of the call report, you need to combine it with the {base_url} to compose a download request, and then send the request to download the call report.

Download link format

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

Download link example

GET https://yeastardocs.example.yeastarcloud.com/api/download/QueueSatisfaction-x.7.0.7-download-20220608094753-ejP6Z6htIfhsCQbP.csv?access_token=MB1OklPar5hnDfhi4srZa8FrZ4znFSzr HTTP/1.1