To retrieve a report subscription via the command line, proceed as follows.

Identify the Report Subscription

You will need the ID of the report subscription. Unfortunately, this is not currently possible via the web interface. You will need to query the database:


SELECT * FROM ReportSubscriptions WHERE Name = 'My Report Subscription';



Make an note of the returned ID.

Run the Report Subscription

The report subscription can be run via the command line, using the URL specified in the following system parameter:

Portal.WebServer.StatisticsServlet.URL

For example:

http://acd-lb/CarrierPortal/StatisticsReportsServlet

http GET

To execute the subscription, execute a http GET to the URL, replacing <ID> with the report subscriptions ID:


http://acd-lb/CarrierPortal/StatisticsReportsServlet?ReportSubscriptions_ID=91



Using curl

Installing curl

If using linux, curl can be installed using the following command:


yum -y install curl



If using Windows, curl can be installed as part of the cygwin package.

Retrieving with curl

Replace <ID> with the ID of the relevant report subscription:


curl -k -s http://acd-lb/CarrierPortal/StatisticsReportsServlet?ReportSubscriptions_ID=<ID>



Output

If successful, the output will be XML, which contains the filename of the generated report. 

For example:


<?xml version='1.0' encoding='UTF-8' ?>
<report>
<filename>
//acd-store/shared/Data/clients/1/reports/Statistics_ReportName_20200301_090000_100.csv
</filename>
</report>



Extract the Report File Name

Parsing the XML

If you are using a programming language or script language which can parse XML, then you can extract the filename of the generated report using the following XPath expression:


/report/filename



Using the Command Line

If you are using curl from cygwin or from linux, you can extract the filename using sed as follows:


curl -k -s http://acd-lb/CarrierPortal/StatisticsReportsServlet?ReportSubscriptions_ID=<ID> | sed -n '4 p'



This will return the extracted filename to stdout.