REST Example - Rule matches
This page gives an example to fetch match count of Action Rules, Routing Rules and SLA Rules.
Rule Types
ACTION_RULE_MATCH_COUNT
ROUTING_RULE_MATCH_COUNT
SLA_1_RULE_MATCH_COUNT
SLA_2_RULE_MATCH_COUNT
SLA_1_RULE_MISS_COUNT
SLA_2_RULE_MISS_COUNT
Fetch
This API call returns a aggregated object of rule matches https://developers.chatvisor.com/#operation/getUsingPOST_5
POST https://api.chatvisor.com/rest/v1/report/rule/?access_token=<TOKEN>
BODY:
{
"metrics": [
{
"metricName": "ACTION_RULE_MATCH_COUNT"
}
],
"dateFilter": {
"grouping": "TODAY"
}
}
POST https://api.chatvisor.com/rest/v1/report/rule/?access_token=<TOKEN>
BODY:
{
"metrics": [
{
"metricName": "ACTION_RULE_MATCH_COUNT",
"ruleIds": ["<ID>"]
}
],
"dateFilter": {
"grouping": "TODAY"
}
}
{
"results": {
"2020/11/02 15": {
"ACTION_RULE_MATCH_COUNT": "7"
},
"2020/11/02 16": {
"ACTION_RULE_MATCH_COUNT": "2"
},
"2020/11/02 17": {
"ACTION_RULE_MATCH_COUNT": "1"
}
}
}
The ID of a rule can be found in the backend of TeamViewer Engage within the details of the Action Rules/SLA rules... menu.