Scroll

How to run reports from CcaWebAPI?

How to run reports from CcaWebAPI?

Follow

1/ get the list or reports and Ids:


GET: http://[WebServer]/CcaWebAPI/Reports

Extract:
{
"CcaObjectTypesUsedInParameters": [
7
],
"Revision": 0,
"Type": 0,
"CcaObjectType": 30,
"DateCreated": "2018-02-23T10:07:55.999",
"DateModified": "2018-02-23T10:07:55.999",
"Description": "Standard Report (v2)",
"Id": 2,
"Name": "Agent Outbound Calls (v2)"
},

 

2/ get a list of parameters for a specific report (here the "Agent Outbound calls (v2)" with Id=2:


{
"Request": {
"Method": "GET",
"Url": "http://[WebServer]/CcaWebAPI/Reports/2/parameters"
},
"Version": "5.4.9.6",
"StatusCode": 200,
"Response": [
{
"AllowBlank": false,
"DataType": 31,
"DefaultValues": null,
"Hidden": false,
"MultiValue": true,
"Name": "Filter1",
"Nullable": false,
"Prompt": "Task?"
},
{
"AllowBlank": false,
"DataType": 4,
"DefaultValues": null,
"Hidden": false,
"MultiValue": false,
"Name": "Filter3",
"Nullable": false,
"Prompt": "Time interval?"
}
]
}

 

 3/ Run a report: Outbound calls on survey id 1371 from 03 sept 2019 00h00 till 17 setp 2019 23h59 and get it in pdf file.

POST: http://[WebServer]/CcaWebAPI/Reports/2/Run?output=1

 

 

Header:

Add the Content-Type = application/json

 

Body:

{
"Filter1": "1361","Filter3": "2019-09-03T00:00:00;2019-09-17T23:59:59"
}

 

Output: 

 

Output Name
0 Rpt
1 Pdf
2 Xls
3 Doc
4 Raw
5 Rtf
6 Rtf_edit
7 Xls_data
8 Xls_data_minimal
9 Csv
10 Tsv
11 Html32
12 Html40
13 Xml
14 Txt

 

 

You will get an answer from APi with a QID:

{

"Request": {

"Method": "POST",

"Url": "http://[WebServer]/CcaWebAPI/Reports/2/Run?output=1"

},

"Version": "5.4.9.6",

"StatusCode": 200,

"Response": {

"qid": 193

}

}

 

 4/ Then download your file with the qid received:

http://[webserver]/CcaWebAPI/Reports/Requests/193/download

 

 

 

Have more questions? Submit a request

Comments