...
resolution
: Will take one of the values from “hourly” and “daily”. Hourly stats will give hour-wise cumulative stats of the selected attribute/s for last 24 hours; daily stats will accumulate all the stats day-wise for last 7 days.aggregateType
: Must be one of the “SUM”, “AVERAGE” or “COUNT”. This aggregation type will be used to aggregate all the selected attribute/sattributes
: List of selected attributescomparison
: This boolean flag would be true for comparison of the same attribute over this and the last week and would be false for comparison of different attributes over the same time period. The time period will depend on the value ofresolution.
filterAttributes
: A list of attributes on which the data will be filtered. This list would contain the names of the attributesfilterValues
: An array of arrays corresponding to the filter values. The array at first index will have values of the first filter and so on.- chartType: Its value is either "Line Chart" or "Bar Chart". if no value is provided (i.e: empty string) then it sends Line Chart by default.
Line Chart Query (Historical)
Sample Query:
getHistoricalData (resolution: "hourly",
aggregateType: "count",
attributes: {val: ["currentStatecallsAbandoned"]},
comparison: "true",
filterAttributes: {val:["team", "skillGroup"]},
filterValues: {val: [[1, 2, 3], [4, 5, 6]],chartType:"Line Chart"})
{
name
series
}
Result:
...
{ "value": 5, "name": "2016-09-17T12:47:17.425Z" }, { "value": 10, "name": "2016-09-19T17:07:51.824Z" }, { "value": 15, "name": "2016-09-20T10:30:15.408Z" }, { "value": 10, "name": "2016-09-13T10:41:32.861Z" }, { "value": 8, "name": "2016-09-21T18:23:16.441Z" }]
}
]
Bar Chart Query (Historical)
Bar Chart also support the same input arguments as of line chart, only its output response is different. The sample query and expected result of bar chart query is as follow:
Sample Query:
getHistoricalData (resolution: "hourly",
aggregateType: "count",
attributes: {val: ["callsAbandoned","callsReceived","callsAnswered"]},
comparison: "true",
filterAttributes: {val:["queue","skillGroup"]},
filterValues: {val: [[1, 2, 3], [4, 5, 6]],chartType:"Bar Chart"})
{
name
series
}
Result when comparison is false (i.e comparison of multiple attributes in single week)
Result:
[
{
name: "Mon"
series: [
{ "name": "Received",
"value": 490 }, { "name": "Answered",
"value": 490 }, { "name": "Abandoned",
"value": 490 }
]
},
{
name: "Tue"
series: [
{ "name": "Received",
"value": 490 }, { "name": "Answered",
"value": 321 }, { "name": "Abandoned",
"value": 700 }
]
},
{
name: "Wed"
series: [
{ "name": "Received",
"value": 490 }, { "name": "Answered",
"value": 570 }, { "name": "Abandoned",
"value": 220 }
]
}
]
Result when comparison is true (i.e comparison of same attribute for this and previous week)
Result:
[
{
name: "Mon"
series: [
{ "name": "This week",
"value": 490 }, { "name": "Previous Week",
"value": 490 }
]
},
{
name: "Tue"
series: [
{ "name": "This Week",
"value": 490 }, { "name": "Previous Week",
"value": 321 }
]
}
]