Comm100 has introduced the Custom Report feature on Nov 7, 2022, which has brought in changes in the Reporting API. This article introduces the details of the API changes after the release of Custom Report. If you are using reporting API, you need to update the API parameters accordingly.
The API changes includes the following:
- In the Cube Query entity, the conditionExpression field changes to conditionMatchType.
- The parameter used to query data under the AgentStatusLog entity.
Change of conditionExpression
In previous version, conditionExpression is used to filter fields. Its values include the condition name. After the change, conditionMatchType is used to indicate the relationships of multiple conditions, and only accepts all or any as its value.
For example, to query the average wait time for missed chat from auto invitation, the code sample before and after the change are as follows:
Code sample before the change:
{
"cubeEntities": [
{
"name": "Chat",
"fields": [
{
"name": "avgWaitingTime",
"calculationType": "average",
"valueType": "timespan",
"conditionExpression": "missed & autoInvitation",//this field is deprecated.
"fieldName": "WaitingTime",
"conditions": [
{
"name": "missed",
"fieldName": "Status",
"operate": "equals",
"values": ["2"]
},
{
"name": "autoInvitation",
"fieldName": "Source",
"operate": "equals",
"values": ["1"]
}
]
}
]
}
]
}
Code sample after the change:
{
"cubeEntities": [
{
"name": "Chat",
"fields": [
{
"name": "avgWaitingTime",
"calculationType": "average",
"valueType": "timespan",
"conditionMatchType": "all",//this is a new field used to replace conditionExpression.
"fieldName": "WaitingTime",
"conditions": [
{
"name": "missed",
"fieldName": "Status",
"operate": "equals",
"values": ["2"]
},
{
"name": "autoInvitation",
"fieldName": "Source",
"operate": "equals",
"values": ["1"]
}
]
}
]
}
]
}
AgentStatusLog Query Field Change
Previously, the parameter name was used to query data under the AgentStatusLog entity. After the change, fieldName is used for the query. You need to make sure the fieldName is correct when querying a specific metric.
Query Metric
|
Old Sample Code
|
New Sample Code
|
Agent login time |
|
|
Agent linear chat time |
|
|
Agent idle time |
|
|
Agent online time |
|
|
Agent away time |
|
|