Report
  • 04 Jan 2023
  • 40 Minutes to read
  • Dark
    Light

Report

  • Dark
    Light

Article summary

Reports

  • Reports - Reports Manage
    • POST reportingquery/reports/query - Get a Report

Report JSON Format

Report is represented as simple flat JSON objects with the following keys:

NameTypeDescription
totalobjectA key-value dictionary based on query, the keys is comes from cube query entity's fields.
seriesobject[]An array of dictionary based on query, the data of this array is obtained by dividing all the data according to the row group. For example, the value in the row group is department, then each item of data in this array is obtained according to a different department.

Get a Report

POST reportingquery/reports/query

JSON Format

NameTypeRequiredDescription
cubeEntitiescubeQuery[]yesRefer to Cube Query. For a report query, you can specify multiple cube queries. For example, you may to query "ticket" and "chat" and merge together in one report.
mergeTypestringyesIndicates how to merge the result sets of different cube query. Allowed values are "column", "row". Merging by "column" requires that two queries have the same row group.
timezonestringyesThe name of the timezone.

Cube Query JSON Format

NameTypeDescription
namestringThe cube name you need to query.
fieldsfield[]Reference to Field.
rowGroupsrowGroup[]Reference to Row Group.
filtersfilter[]Reference to Filter.

Field JSON Format

NameTypeDescription
namestringSpecifies the name of the field, which will be used in the returned results.
calculationTypestringSpecifies how the field is calculated. Allowed values are "count", "max", "average", "sum", "expression", "originalValue", "uniqueCount".
valueTypestringSpecifies the type of result value. Allowed values are "int", "decimal", "percent", "timespan", "string".
expressionstringFor some fields that need to be calculated using other fields, we can configure the evaluation expression. We can use "+", "-", "*", "/" and "()".
fieldNamestringCorresponding to the field name in the cube entity.
conditionMatchTypestringIndicates whether all conditions or any conditions need to be matched. Allowed values are "all", "any".
conditionsfieldCondition[]For some metrics, we may only calculate data for certain conditions. Reference to Field Condition.

Field Condition JSON Format

NameTypeDescription
namestringName of the field condition.
fieldNamestringName of the field, point to the field used for get data based on condition, only data that meets the conditions will be counted in the results.
operatestringAllowed values are "equals", "notEquals".
valuesstring[]Array of values used as conditions.

Row Group JSON Format

NameTypeDescription
namestringName of the row group.
fieldNamestringName of the field, point to the field used for group data.
isFullboolThe field corresponding to fieldName, if its type is reference, decide whether to return all possible values of that field according to the value of isFull, regardless of whether the group corresponding to that value has data.
timeDisplayTypestringAllowed values are "hour", "day", "week", "month", "_24x7", "halfHour".

Filter JSON Format

NameTypeDescription
fieldNamestringName of the field, point to the field used for filter data, used to obtain part of the data according to specific conditions, such as a certain agent, a certain department, a certain period of time data.
matchTypestringAllowed values are "equals", "notEquals", "between", "lessThan", "greaterThan".
valuestring[]Array of values to filter data.

Response

An array of Report

Chat Volume

Provides the number of visits and chats (including refused and missed chats) within a specific time period.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "chats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status0",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "0"
                            ]
                        }
                    ]
                },
                {
                    "name": "missedChats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "missedChatStatus",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "2",
                                "3"
                            ]
                        }
                    ]
                },
                {
                    "name": "refusedChats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "refusedChatStatus",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "chatRequests",
                    "calculationType": "expression",
                    "valueType": "int",
                    "expression": "chats + missedChats + refusedChats",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "chatAcceptanceRate",
                    "calculationType": "expression",
                    "valueType": "percent",
                    "expression": "chats / chatRequests",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "RequestedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/03/25",
                        "2021/04/23"
                    ]
                }
            ]
        },
        {
            "name": "VisitsStatistics",
            "fields": [
                {
                    "name": "visits",
                    "calculationType": "sum",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "VisitCount",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "LogTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "LogTime",
                    "matchType": "between",
                    "value": [
                        "2021/03/25",
                        "2021/04/23"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}'

Response:

HTTP/1.1 200 OK

{
    "total": {
        "chats": 37,
        "missedChats": 9,
        "refusedChats": 1,
        "visits": 79,
        "chatRequests": 47.0,
        "chatAcceptanceRate": 78.72
    },
    "series": [
        {
            "time": "2021-03-25",
            "chats": 1.0,
            "missedChats": 0.0,
            "refusedChats": 0.0,
            "chatRequests": 1.0,
            "chatAcceptanceRate": 100.0,
            "visits": 2.0
        },
        //...
    ]
  } 

Ticketing Real Time

The report of ticketing Real time details.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "unassignedTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "AssigneeId",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "noAgent",
                            "fieldName": "AssigneeId",
                            "operate": "equals",
                            "values": [
                                "00000000-0000-0000-0000-000000000000"
                            ]
                        },
                        {
                            "name": "noDepartment",
                            "fieldName": "DepartmentAssigneeId",
                            "operate": "equals",
                            "values": [
                                "00000000-0000-0000-0000-000000000000"
                            ]
                        }
                    ]
                },
                {
                    "name": "openTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "notResolved",
                            "fieldName": "Status",
                            "operate": "notEquals",
                            "values": [
                                "5"
                            ]
                        }
                    ]
                },
                {
                    "name": "newTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status1",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "pendingInternalTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status2",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "2"
                            ]
                        }
                    ]
                },
                {
                    "name": "pendingExternalTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status3",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "3"
                            ]
                        }
                    ]
                },
                {
                    "name": "onHoldTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status4",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "4"
                            ]
                        }
                    ]
                },
                {
                    "name": "urgentTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Priority",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status1",
                            "fieldName": "Priority",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "highPriorityTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Priority",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status2",
                            "fieldName": "Priority",
                            "operate": "equals",
                            "values": [
                                "2"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "lessThan",
                    "value": [
                        "2021/05/31"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        },
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "todayCreatedTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Id",
                    "conditions": []
                }
            ],
            "rowGroups": [],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/30",
                        "2021/05/30"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        },
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "todayResolvedTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": []
                }
            ],
            "rowGroups": [],
            "filters": [
                {
                    "fieldName": "ResolvedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/30",
                        "2021/05/30"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        },
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "todayRepliedTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "uniqueCount",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "SentByType1",
                            "fieldName": "Message.SentByType",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [],
            "filters": [
                {
                    "fieldName": "Message.Time",
                    "matchType": "between",
                    "value": [
                        "2021/05/30",
                        "2021/05/30"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        },
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "todayReopenedTickets",
                    "valueType": "int",
                    "expression": "",
                    "calculationType": "count",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": []
                }
            ],
            "rowGroups": [],
            "filters": [
                {
                    "fieldName": "ReopenedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/30",
                        "2021/05/30"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}'

Response:

HTTP/1.1 200 OK

{
    "total": {
        "unassignedTickets": 124,
        "openTickets": 1010,
        "newTickets": 420,
        "pendingInternalTickets": 478,
        "pendingExternalTickets": 106,
        "onHoldTickets": 6,
        "urgentTickets": 281,
        "highPriorityTickets": 432,
        "todayCreatedTickets": 13,
        "todayResolvedTickets": 5,
        "todayRepliedTickets": 11,
        "todayReopenedTickets": 2
    },
    "series": [
        {
            "unassignedTickets": 124.0,
            "openTickets": 1010.0,
            "newTickets": 420.0,
            "pendingInternalTickets": 478.0,
            "pendingExternalTickets": 106.0,
            "onHoldTickets": 6.0,
            "urgentTickets": 281.0,
            "highPriorityTickets": 432.0,
            "todayCreatedTickets": 13.0,
            "todayResolvedTickets": 5.0,
            "todayRepliedTickets": 11.0,
            "todayReopenedTickets": 2.0
        }
    ]
  } 

Ticketing Volume

The report of ticketing volume by day.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "openTickets",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status!5",
                            "fieldName": "Status",
                            "operate": "notEquals",
                            "values": [
                                "5"
                            ]
                        }
                    ]
                },
                {
                    "name": "createdTickets",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": []
                },
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "CreatedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/29",
                        "2021/05/29"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        },
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "resolvedTickets",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "ResolvedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "ResolvedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/29",
                        "2021/05/29"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        },
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "reopenedTickets",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "ReopenedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "ReopenedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/29",
                        "2021/05/29"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        },
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "repliedTickets",
                    "calculationType": "uniqueCount",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "SentByType1",
                            "fieldName": "Message.SentByType",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "visitorMessages",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Message.SentByType",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "SentByType3",
                            "fieldName": "Message.SentByType",
                            "operate": "equals",
                            "values": [
                                "3",
                                "4"
                            ]
                        }
                    ]
                },
                {
                    "name": "agentMessages",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Message.SentByType",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "SentByType",
                            "fieldName": "Message.SentByType",
                            "operate": "equals",
                            "values": [
                                "1",
                                "5"
                            ]
                        }
                    ]
                },
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "Message.Time",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "Message.Time",
                    "matchType": "between",
                    "value": [
                        "2021/05/29",
                        "2021/05/29"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}'

Response:

HTTP/1.1 200 OK

{
    "total": {
        "openTickets": 3,
        "createdTickets": 3,
        "resolvedTickets": 1,
        "reopenedTickets": 0,
        "repliedTickets": 3,
        "visitorMessages": 3,
        "agentMessages": 6
    },
    "series": [
        {
            "time": "2021-05-29",
            "openTickets": 3.0,
            "createdTickets": 3.0,
            "resolvedTickets": 1.0,
            "reopenedTickets": 0,
            "repliedTickets": 3.0,
            "visitorMessages": 3.0,
            "agentMessages": 6.0
        }
    ]
  } 

Ticketing Channel

The report of ticketing channel by day.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "email",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelIdEmail",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "Email"
                            ]
                        }
                    ]
                },
                {
                    "name": "facebookWallPost",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelFacebookWallPost",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "FacebookWallPost"
                            ]
                        }
                    ]
                },
                {
                    "name": "facebookVisitorPost",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelFacebookVisitorPost",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "FacebookVisitorPost"
                            ]
                        }
                    ]
                },
                {
                    "name": "facebookMessenger",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelFacebookMessenger",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "FacebookMessenger"
                            ]
                        }
                    ]
                },
                {
                    "name": "facebookTotal",
                    "calculationType": "expression",
                    "valueType": "int",
                    "expression": "facebookWallPost + facebookVisitorPost + facebookMessenger",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "tweet",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelTweet",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "Tweet"
                            ]
                        }
                    ]
                },
                {
                    "name": "tweeterDirectMessage",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelTweeterDirectMessage",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "TwitterDirectMessage"
                            ]
                        }
                    ]
                },
                {
                    "name": "tweeterTotal",
                    "calculationType": "expression",
                    "valueType": "int",
                    "expression": "tweet + tweeterDirectMessage",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "weChat",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelWeChat",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "Wechat"
                            ]
                        }
                    ]
                },
                {
                    "name": "sms",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelSms",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "SMS"
                            ]
                        }
                    ]
                },
                {
                    "name": "whatsApp",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelWhatsApp",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "WhatsApp"
                            ]
                        }
                    ]
                },
                {
                    "name": "chat",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelChat",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "Chat"
                            ]
                        }
                    ]
                },
                {
                    "name": "offlineMessage",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelOfflineMessage",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "OfflineMessage"
                            ]
                        }
                    ]
                },
                {
                    "name": "internal",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChannelInternal",
                            "fieldName": "ChannelId",
                            "operate": "equals",
                            "values": [
                                "Internal"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "CreatedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/29",
                        "2021/05/29"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}'

Response:

HTTP/1.1 200 OK

{
    "total": {
        "email": 1,
        "facebookWallPost": 0,
        "facebookVisitorPost": 0,
        "facebookMessenger": 0,
        "tweet": 0,
        "tweeterDirectMessage": 1,
        "weChat": 0,
        "sms": 0,
        "whatsApp": 0,
        "chat": 0,
        "offlineMessage": 0,
        "internal": 1,
        "facebookTotal": 0.0,
        "tweeterTotal": 1.0
    },
    "series": [
        {
            "time": "2021-05-29",
            "email": 1.0,
            "facebookWallPost": 0.0,
            "facebookVisitorPost": 0.0,
            "facebookMessenger": 0.0,
            "facebookTotal": 0.0,
            "tweet": 0.0,
            "tweeterDirectMessage": 1.0,
            "tweeterTotal": 1.0,
            "weChat": 0.0,
            "sms": 0.0,
            "whatsApp": 0.0,
            "chat": 0.0,
            "offlineMessage": 0.0,
            "internal": 1.0
        }
    ]
  } 

Ticketing Efficiency

The report of ticketing efficiency by day.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "allChannels",
                    "calculationType": "uniqueCount",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "avgResponseTime",
                    "calculationType": "expression",
                    "valueType": "timespan",
                    "expression": "sumResponseTime/sumResponseCount",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "avgFirstResponseTime",
                    "calculationType": "average",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "FirstResponseTimeSpan",
                    "conditions": []
                },
                {
                    "name": "avgTicketTime",
                    "calculationType": "average",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "ResolvedTimeSpan",
                    "conditions": []
                },
                {
                    "name": "avgVisitorMessages",
                    "calculationType": "expression",
                    "valueType": "decimal",
                    "expression": "visitorMessages/allChannels",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "avgAgentMessages",
                    "calculationType": "expression",
                    "valueType": "decimal",
                    "expression": "agentMessages/allChannels",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "sumResponseCount",
                    "calculationType": "sum",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "ResponseCount",
                    "conditions": []
                },
                {
                    "name": "sumResponseTime",
                    "calculationType": "sum",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "ResponseTimeSpan",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "CreatedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/29",
                        "2021/05/29"
                    ]
                },
                {
                    "fieldName": "Status",
                    "matchType": "equals",
                    "value": [
                        "5"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        },
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "visitorMessages",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Message.SentByType",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "SentByType3",
                            "fieldName": "Message.SentByType",
                            "operate": "equals",
                            "values": [
                                "3", 
                                "4"
                            ]
                        }
                    ]
                },
                {
                    "name": "agentMessages",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Message.SentByType",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "SentByType",
                            "fieldName": "Message.SentByType",
                            "operate": "equals",
                            "values": [
                                "1",
                                "5"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "CreatedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/29",
                        "2021/05/29"
                    ]
                },
                {
                    "fieldName": "Status",
                    "matchType": "equals",
                    "value": [
                        "5"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}'

Response:

HTTP/1.1 200 OK

{
    "total": {
        "allChannels": 0,
        "avgFirstResponseTime": 0.0,
        "avgTicketTime": 0.0,
        "sumResponseCount": 0,
        "sumResponseTime": 0,
        "visitorMessages": 0,
        "agentMessages": 0,
        "avgResponseTime": 0.0,
        "avgVisitorMessages": 0.0,
        "avgAgentMessages": 0.0
    },
    "series": [
        {
            "time": "2021-05-29",
            "allChannels": 0,
            "avgResponseTime": 0.0,
            "avgFirstResponseTime": 0,
            "avgTicketTime": 0,
            "avgVisitorMessages": 0.0,
            "avgAgentMessages": 0.0,
            "sumResponseCount": 0,
            "sumResponseTime": 0,
            "visitorMessages": 0,
            "agentMessages": 0
        }
    ]
  } 

Ticketing SLA Policies

The report of ticketing SLA Policies.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Ticket",
            "fields": [
                {
                    "name": "slaPolicyId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "TicketSLA.SlaPolicy.Id",
                    "conditions": []
                },
                {
                    "name": "slaPolicy",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "TicketSLA.SlaPolicy.Name",
                    "conditions": []
                },
                {
                    "name": "firstResponseSlaCount",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "FirstRespondBreachStatus1",
                            "fieldName": "TicketSLA.FirstRespondBreachStatus",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "firstResponseSlaTotal",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "FirstRespondBreachStatus123",
                            "fieldName": "TicketSLA.FirstRespondBreachStatus",
                            "operate": "equals",
                            "values": [
                                "1",
                                "2",
                                "3"
                            ]
                        }
                    ]
                },
                {
                    "name": "firstRespondRate",
                    "calculationType": "expression",
                    "valueType": "percent",
                    "expression": "firstResponseSlaCount/firstResponseSlaTotal",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "firstRespondDuration",
                    "calculationType": "sum",
                    "valueType": "decimal",
                    "expression": "",
                    "fieldName": "TicketSLA.FirstRespondDuration",
                    "conditions": []
                },
                {
                    "name": "FirstRespondDurationTotal",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "FirstRespondBreachStatus13",
                            "fieldName": "TicketSLA.FirstRespondBreachStatus",
                            "operate": "equals",
                            "values": [
                                "1",
                                "3"
                            ]
                        }
                    ]
                },
                {
                    "name": "avgFirstRespondSlaTime",
                    "calculationType": "expression",
                    "valueType": "timespan",
                    "expression": "firstRespondDuration/FirstRespondDurationTotal",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "sumNextRespondCount",
                    "calculationType": "sum",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "TicketSLA.NextRespondCount",
                    "conditions": []
                },
                {
                    "name": "sumNextRespondBreachCount",
                    "calculationType": "sum",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "TicketSLA.NextRespondBreachCount",
                    "conditions": []
                },
                {
                    "name": "nextResponseSlaRate",
                    "calculationType": "expression",
                    "valueType": "percent",
                    "expression": "(sumNextRespondCount-sumNextRespondBreachCount)/sumNextRespondCount",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "sumNextRespondDuration",
                    "calculationType": "sum",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "TicketSLA.NextRespondDuration",
                    "conditions": []
                },
                {
                    "name": "avgNextRespondSlaTime",
                    "calculationType": "expression",
                    "valueType": "timespan",
                    "expression": "sumNextRespondDuration/sumNextRespondCount",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "resolutionSlaCount",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ResolveTimeBreachStatus1",
                            "fieldName": "TicketSLA.ResolveTimeBreachStatus",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "resolutionSlaCountTotal",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ResolveTimeBreachStatus1234",
                            "fieldName": "TicketSLA.ResolveTimeBreachStatus",
                            "operate": "equals",
                            "values": [
                                "1",
                                "2",
                                "3",
                                "4"
                            ]
                        }
                    ]
                },
                {
                    "name": "resolutionSlaRate",
                    "calculationType": "expression",
                    "valueType": "percent",
                    "expression": "resolutionSlaCount/resolutionSlaCountTotal",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "sumResolvedDuration",
                    "calculationType": "sum",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "TicketSLA.ResolvedDuration",
                    "conditions": []
                },
                {
                    "name": "resolutionSlaDurationTotal",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ResolveTimeBreachStatus134",
                            "fieldName": "TicketSLA.ResolveTimeBreachStatus",
                            "operate": "equals",
                            "values": [
                                "1",
                                "3",
                                "4"
                            ]
                        }
                    ]
                },
                {
                    "name": "avgResolutionSlaTime",
                    "calculationType": "expression",
                    "valueType": "timespan",
                    "expression": "sumResolvedDuration/resolutionSlaDurationTotal",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "breachTickets",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "any",
                    "conditions": [
                        {
                            "name": "FirstRespondBreachStatus23",
                            "fieldName": "TicketSLA.FirstRespondBreachStatus",
                            "operate": "equals",
                            "values": [
                                "2",
                                "3"
                            ]
                        },
                        {
                            "name": "ResolveTimeBreachStatus23",
                            "fieldName": "TicketSLA.ResolveTimeBreachStatus",
                            "operate": "equals",
                            "values": [
                                "2",
                                "3"
                            ]
                        },
                        {
                            "name": "NextRespondBreachCount23",
                            "fieldName": "TicketSLA.NextRespondBreachCount",
                            "operate": "equals",
                            "values": [
                                "2",
                                "3"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "slaPolicyId",
                    "fieldName": "TicketSLA.SlaPolicyId",
                    "isFull": true
                }
            ],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/29",
                        "2021/05/29"
                    ]
                },
                {
                    "fieldName": "MergedToTargetId",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "IsInRecycleBin",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "TicketSLA.SlaPolicy.Id",
                    "matchType": "notEquals",
                    "value": [
                        null
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "firstResponseSlaCount": 0,
        "firstResponseSlaTotal": 0,
        "firstRespondDuration": 0.0,
        "firstRespondDurationTotal": 0,
        "sumNextRespondCount": 0,
        "sumNextRespondBreachCount": 0,
        "sumNextRespondDuration": 0,
        "resolutionSlaCount": 0,
        "resolutionSlaCountTotal": 0,
        "sumResolvedDuration": 0,
        "resolutionSlaDurationTotal": 0,
        "breachTickets": 0,
        "firstRespondRate": 0.0,
        "avgFirstRespondSlaTime": 0.0,
        "nextResponseSlaRate": 0.0,
        "avgNextRespondSlaTime": 0.0,
        "resolutionSlaRate": 0.0,
        "avgResolutionSlaTime": 0.0
    },
    "series": [
        {
            "slaPolicyId": "d8ee141e-ab12-4575-86af-fa7058d6d16f",
            "slaPolicy": "oden sla",
            "firstResponseSlaCount": 0.0,
            "firstResponseSlaTotal": 0.0,
            "firstRespondRate": 0.0,
            "firstRespondDuration": 0.0,
            "firstRespondDurationTotal": 0.0,
            "avgFirstRespondSlaTime": 0.0,
            "sumNextRespondCount": 0.0,
            "sumNextRespondBreachCount": 0.0,
            "nextResponseSlaRate": 0.0,
            "sumNextRespondDuration": 0.0,
            "avgNextRespondSlaTime": 0.0,
            "resolutionSlaCount": 0.0,
            "resolutionSlaCountTotal": 0.0,
            "resolutionSlaRate": 0.0,
            "sumResolvedDuration": 0.0,
            "resolutionSlaDurationTotal": 0.0,
            "avgResolutionSlaTime": 0.0,
            "breachTickets": 0.0
        },
        //...
    ]
  } 

Agent Availability

The report of agent availability by Month.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "AgentStatusLog",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "online",
                    "calculationType": "sum",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "OnlineTime",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "StartTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "StartTime",
                    "matchType": "between",
                    "value": [
                        "2021/04/27",
                        "2021/05/26"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "online": 224169.1433333
    },
    "series": [
        {
            "time": "2021-04-27",
            "online": 224169.1433333
        },
        //...
    ]
  } 

Canned Message

The report of Canned Messages usage.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "CannedMessageUseRecord",
            "fields": [
                {
                    "name": "cannedMessage",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "CannedMessage.Name",
                    "conditions": []
                },
                {
                    "name": "usedTimes",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "usedAgents",
                    "calculationType": "uniqueCount",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "AgentId",
                    "conditions": []
                },
                {
                    "name": "cannedMessageId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "CannedMessage.Id",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "cannedMessageId",
                    "fieldName": "CannedMessage.Id",
                    "isFull": true
                }
            ],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "between",
                    "value": [
                        "2021/04/27",
                        "2021/05/26"
                    ]
                },
                {
                    "fieldName": "CannedMessage.Id",
                    "matchType": "notEquals",
                    "value": [
                        null
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "usedTimes": 0,
        "usedAgents": 0
    },
    "series": [
        {
            "cannedMessageId": "cea66fff-3ca2-eb11-aad0-06f950e5291d",
            "cannedMessage": "Hello",
            "usedTimes": 0.0,
            "usedAgents": 0.0
        }
    ]
  } 

Chat Source

Provides the number of chats initiated by visitors, by agents, or by predefined rules as well as the request page of those chats.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "chatsByVisitors",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Source",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Source0",
                            "fieldName": "Source",
                            "operate": "equals",
                            "values": [
                                "0"
                            ]
                        },
                        {
                            "name": "NormalStatus",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "0"
                            ]
                        },
                        {
                            "name": "NormalStatus",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "0"
                            ]
                        }
                    ]
                },
                {
                    "name": "chatsFromAutoInvitation",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Source",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Source1",
                            "fieldName": "Source",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        },
                        {
                            "name": "NormalStatus",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "0"
                            ]
                        }
                    ]
                },
                {
                    "name": "chatsFromManualInvitation",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Source",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Source2",
                            "fieldName": "Source",
                            "operate": "equals",
                            "values": [
                                "2"
                            ]
                        },
                        {
                            "name": "NormalStatus",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "0"
                            ]
                        }
                    ]
                },
                {
                    "name": "chats",
                    "calculationType": "expression",
                    "valueType": "int",
                    "expression": "chatsByVisitors + chatsFromAutoInvitation + chatsFromManualInvitation",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "RequestedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/04/27",
                        "2021/05/26"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "chatsByVisitors": 21,
        "chatsFromAutoInvitation": 0,
        "chatsFromManualInvitation": 0,
        "chats": 21.0
    },
    "series": [
        {
            "time": "2021-04-27",
            "chatsByVisitors": 7.0,
            "chatsFromAutoInvitation": 0.0,
            "chatsFromManualInvitation": 0.0,
            "chats": 7.0
        },
        //...
    ]
  } 

Chat Queue

Shows the number of visitors who waited in the queue, abandoned the queue, switched to offline message or were refused by agents.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "queuedChatRequests",
                    "calculationType": "expression",
                    "valueType": "int",
                    "expression": "chatsFromQueue+switchedToMessaged+abandonedChats+refusedChats",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "chatsFromQueue",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status0",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "0"
                            ]
                        }
                    ]
                },
                {
                    "name": "switchedToMessaged",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status2",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "2"
                            ]
                        },
                        {
                            "name": "ChatType16",
                            "fieldName": "ChatType",
                            "operate": "equals",
                            "values": [
                                "16"
                            ]
                        }
                    ]
                },
                {
                    "name": "abandonedChats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status4",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "2"
                            ]
                        },
                        {
                            "name": "ChatTypeNot16",
                            "fieldName": "ChatType",
                            "operate": "notEquals",
                            "values": [
                                "16"
                            ]
                        }
                    ]
                },
                {
                    "name": "refusedChats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status1",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "RequestedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                },
                {
                    "fieldName": "IsQueued",
                    "matchType": "equals",
                    "value": [
                        "1"
                    ]
                }
            ]
        },
        {
            "name": "QueueStatistics",
            "fields": [
                {
                    "name": "maxQueueSize",
                    "calculationType": "max",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "QueueLength",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "Time",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "Time",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "chatsFromQueue": 40,
        "switchedToMessaged": 0,
        "abandonedChats": 18,
        "refusedChats": 1,
        "maxQueueSize": 1,
        "queuedChatRequests": 59.0
    },
    "series": [
        {
            "time": "2021-02-01",
            "queuedChatRequests": 0.0,
            "chatsFromQueue": 0,
            "switchedToMessaged": 0,
            "abandonedChats": 0,
            "refusedChats": 0,
            "maxQueueSize": 0
        },
        //...
    ]
  } 

Chat Wait Time

Provides the details on visitors' average and the longest wait times within a specific time range.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "avgWaitingTime",
                    "calculationType": "average",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "WaitingTime",
                    "conditionMatchType": "all",
                    "conditions": []
                },
                {
                    "name": "avgWaitingTimeOfMissedChats",
                    "calculationType": "average",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "WaitingTime",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status2",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "2"
                            ]
                        }
                    ]
                },
                {
                    "name": "maxWaitingTime",
                    "calculationType": "max",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "WaitingTime",
                    "conditions": []
                },
                {
                    "name": "maxWaitingTimeOfMissedChats",
                    "calculationType": "max",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "WaitingTime",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status2",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "2"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "RequestedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                },
                {
                    "fieldName": "ChatType",
                    "matchType": "equals",
                    "value": [
                        "0",
                        "2"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "avgWaitingTime": -3162.38,
        "avgWaitingTimeOfMissedChats": 134.11,
        "maxWaitingTime": 702.0,
        "maxWaitingTimeOfMissedChats": 570.0
    },
    "series": [
        {
            "time": "2021-02-01",
            "avgWaitingTime": 0.0,
            "avgWaitingTimeOfMissedChats": 0.0,
            "maxWaitingTime": 0.0,
            "maxWaitingTimeOfMissedChats": 0.0
        },
        //...
    ]
  } 

Chat Transfer

Provides a clear picture on the number of chats being transferred between agents and departments.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "TransferLog",
            "fields": [
                {
                    "name": "totalTransferredChats",
                    "calculationType": "uniqueCount",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "ChatGuid",
                    "conditions": []
                },
                {
                    "name": "departmentTransferredChats",
                    "calculationType": "uniqueCount",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "ChatGuid",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "TransferType1",
                            "fieldName": "TransferType",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "Time",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "Time",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                }
            ]
        },
        {
            "name": "TransferLog",
            "fields": [
                {
                    "name": "departmentTransferredInChats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "TransferType",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "TransferType1",
                            "fieldName": "TransferType",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "Time",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "Time",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                }
            ]
        },
        {
            "name": "TransferLog",
            "fields": [
                {
                    "name": "departmentTransferredOutChats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "TransferType",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "TransferType1",
                            "fieldName": "TransferType",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "Time",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "Time",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                }
            ]
        },
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "chats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "NormalStatus",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "0"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "RequestedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "totalTransferredChats": 2,
        "departmentTransferredChats": 0,
        "departmentTransferredInChats": 0,
        "departmentTransferredOutChats": 0,
        "chats": 333
    },
    "series": [
        {
            "time": "2021-02-01",
            "totalTransferredChats": 0,
            "departmentTransferredChats": 0,
            "departmentTransferredInChats": 0,
            "departmentTransferredOutChats": 0,
            "chats": 2.0
        },
        //...
    ]
  } 

Agent Performance in Live Chat

Provides data regarding agents' overall performance in terms of chat time and wait time within a specific time period.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "avgChatTime",
                    "calculationType": "average",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "Duration",
                    "conditions": []
                },
                {
                    "name": "avgWaitTime",
                    "calculationType": "average",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "WaitingTime",
                    "conditions": []
                },
                {
                    "name": "chats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "totalChatTime",
                    "calculationType": "sum",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "Duration",
                    "conditions": []
                },
                {
                    "name": "lastMessageSentByAgent",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "LastMessageSentBy",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "LastMessageSentBy1",
                            "fieldName": "LastMessageSentBy",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "RequestedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                },
                {
                    "fieldName": "Status",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "ChatType",
                    "matchType": "equals",
                    "value": [
                        "0",
                        "2"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "avgChatTime": 10913.04,
        "avgWaitTime": 190.01,
        "chats": 67,
        "totalChatTime": 731174.0,
        "lastMessageSentByAgent": 16
    },
    "series": [
        {
            "time": "2021-02-01",
            "avgChatTime": 16.0,
            "avgWaitTime": 0.0,
            "chats": 1.0,
            "totalChatTime": 16.0,
            "lastMessageSentByAgent": 1.0
        },
        //...
    ]
  } 

Chat Workload

Gives a comprehensive view on the agent workload by providings data regarding agents' chat time and number of chats handled.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "AgentStatusLog",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "linearChatTime",
                    "calculationType": "count",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "LinearChatTime",
                    "conditions": []
                },
                {
                    "name": "idleTime",
                    "calculationType": "count",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "IdleTime",
                    "conditions": []
                },
                {
                    "name": "loginTime",
                    "calculationType": "count",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "LoggedInTime",
                    "conditions": []
                },
                {
                    "name": "agentUtilization",
                    "calculationType": "expression",
                    "valueType": "percent",
                    "expression": "linearChatTime/loginTime",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "StartTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "StartTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                }
            ]
        },
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "totalChatTime",
                    "calculationType": "sum",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "Duration",
                    "conditions": []
                },
                {
                    "name": "chats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "avgConcurrentChats",
                    "calculationType": "expression",
                    "valueType": "decimal",
                    "expression": "totalChatTime/loginTime",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "RequestedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                },
                {
                    "fieldName": "ChatType",
                    "matchType": "equals",
                    "value": [
                        "0",
                        "2"
                    ]
                },
                {
                    "fieldName": "Status",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "linearChatTime": 0.0,
        "idleTime": 0.0,
        "loginTime": 0.0,
        "totalChatTime": 731174.0,
        "chats": 67,
        "agentUtilization": 0.0,
        "avgConcurrentChats": 0.0
    },
    "series": [
        {
            "time": "2021-02-01",
            "linearChatTime": 0.0,
            "idleTime": 0.0,
            "loginTime": 0.0,
            "agentUtilization": 0.0,
            "totalChatTime": 16.0,
            "chats": 1.0,
            "avgConcurrentChats": 0.0
        },
        //...
    ]
  } 

Agent Efficiency

Provides data regarding the agents' responsiveness, total chat time and visitor wait time.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "avgAgentResponseTime",
                    "calculationType": "average",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "AvgResponseTime",
                    "conditions": []
                },
                {
                    "name": "avgWaitTime",
                    "calculationType": "average",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "WaitingTime",
                    "conditions": []
                },
                {
                    "name": "avgChatTime",
                    "calculationType": "average",
                    "valueType": "timespan",
                    "expression": "",
                    "fieldName": "Duration",
                    "conditions": []
                },
                {
                    "name": "avgAgentChatMessages",
                    "calculationType": "average",
                    "valueType": "decimal",
                    "expression": "",
                    "fieldName": "AgentMessagesCount",
                    "conditions": []
                },
                {
                    "name": "avgVisitorChatMessages",
                    "calculationType": "average",
                    "valueType": "decimal",
                    "expression": "",
                    "fieldName": "VisitorMessagesCount",
                    "conditions": []
                },
                {
                    "name": "avgCannedMessages",
                    "calculationType": "average",
                    "valueType": "decimal",
                    "expression": "",
                    "fieldName": "CannedMessageCount",
                    "conditions": []
                },
                {
                    "name": "lastMessageSentByAgent",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "LastMessageSentBy",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "LastMessageSentBy1",
                            "fieldName": "LastMessageSentBy",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "RequestedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                },
                {
                    "fieldName": "Status",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                },
                {
                    "fieldName": "ChatType",
                    "matchType": "equals",
                    "value": [
                        "0",
                        "2"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "avgAgentResponseTime": 41.77,
        "avgWaitTime": 39.59,
        "avgChatTime": 2212.1,
        "avgAgentChatMessages": 0.88,
        "avgVisitorChatMessages": 0.66,
        "avgCannedMessages": 0.03,
        "lastMessageSentByAgent": 193
    },
    "series": [
        {
            "time": "2021-02-01",
            "avgAgentResponseTime": 0.0,
            "avgWaitTime": 6.58,
            "avgChatTime": 14741.21,
            "avgAgentChatMessages": 0.47,
            "avgVisitorChatMessages": 0.05,
            "avgCannedMessages": 0.0,
            "lastMessageSentByAgent": 5.0
        },
        //...
    ]
  } 

Chat Rating

Provides insights on customer satisfaction by showsing rating scores of individual agents and departments.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "ratingTimes",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "PostChatSurvey.ChatId",
                    "conditions": []
                },
                {
                    "name": "score5",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "PostChatSurvey.RatingGrade",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "RatingGrade5",
                            "fieldName": "PostChatSurvey.RatingGrade",
                            "operate": "equals",
                            "values": [
                                "5"
                            ]
                        }
                    ]
                },
                {
                    "name": "score4",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "PostChatSurvey.RatingGrade",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "RatingGrade4",
                            "fieldName": "PostChatSurvey.RatingGrade",
                            "operate": "equals",
                            "values": [
                                "4"
                            ]
                        }
                    ]
                },
                {
                    "name": "score3",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "PostChatSurvey.RatingGrade",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "RatingGrade3",
                            "fieldName": "PostChatSurvey.RatingGrade",
                            "operate": "equals",
                            "values": [
                                "3"
                            ]
                        }
                    ]
                },
                {
                    "name": "score2",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "PostChatSurvey.RatingGrade",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "RatingGrade2",
                            "fieldName": "PostChatSurvey.RatingGrade",
                            "operate": "equals",
                            "values": [
                                "2"
                            ]
                        }
                    ]
                },
                {
                    "name": "score1",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "PostChatSurvey.RatingGrade",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "RatingGrade1",
                            "fieldName": "PostChatSurvey.RatingGrade",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "avgScore",
                    "calculationType": "average",
                    "valueType": "decimal",
                    "expression": "",
                    "fieldName": "PostChatSurvey.RatingGrade",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "PostChatSurvey.SubmitTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "PostChatSurvey.SubmitTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                },
                {
                    "fieldName": "PostChatSurvey.RatingGrade",
                    "matchType": "greaterThan",
                    "value": [
                        "0"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "ratingTimes": 69,
        "score5": 66,
        "score4": 0,
        "score3": 0,
        "score2": 0,
        "score1": 3,
        "avgScore": 4.83
    },
    "series": [
        {
            "time": "2021-02-01",
            "ratingTimes": 0,
            "score5": 0,
            "score4": 0,
            "score3": 0,
            "score2": 0,
            "score1": 0,
            "avgScore": 0
        },
        //...
    ]
  } 

Post-chat Survey

Provides insight on how visitors felt about agents' professionalism, responsiveness, and helpfulness

.Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "campaignId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Id",
                    "conditions": []
                },
                {
                    "name": "campaignName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Name",
                    "conditions": []
                },
                {
                    "name": "count",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "type",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Type",
                    "conditions": []
                },
                {
                    "name": "fieldId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Id",
                    "conditions": []
                },
                {
                    "name": "fieldName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Name",
                    "conditions": []
                },
                {
                    "name": "score",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "campaignId",
                    "fieldName": "CampaignId",
                    "isFull": false
                },
                {
                    "name": "fieldId",
                    "fieldName": "ChatFieldResult.FieldId",
                    "isFull": false
                },
                {
                    "name": "score",
                    "fieldName": "ChatFieldResult.Value",
                    "isFull": false
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/04/28",
                        "2021/05/27"
                    ]
                },
                {
                    "fieldName": "ChatFieldResult.Field.Type",
                    "matchType": "equals",
                    "value": [
                        "7"
                    ]
                },
                {
                    "fieldName": "ChatFieldResult.FormType",
                    "matchType": "equals",
                    "value": [
                        "2"
                    ]
                }
            ]
        },
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "campaignId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Id",
                    "conditions": []
                },
                {
                    "name": "campaignName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Name",
                    "conditions": []
                },
                {
                    "name": "count",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "option",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "type",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Type",
                    "conditions": []
                },
                {
                    "name": "fieldId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Id",
                    "conditions": []
                },
                {
                    "name": "fieldName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Name",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "campaignId",
                    "fieldName": "CampaignId",
                    "isFull": false
                },
                {
                    "name": "fieldId",
                    "fieldName": "ChatFieldResult.FieldId",
                    "isFull": false
                },
                {
                    "name": "option",
                    "fieldName": "ChatFieldResult.Value",
                    "isFull": false
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/04/28",
                        "2021/05/27"
                    ]
                },
                {
                    "fieldName": "ChatFieldResult.Field.Type",
                    "matchType": "equals",
                    "value": [
                        "3",
                        "4",
                        "5",
                        "6"
                    ]
                },
                {
                    "fieldName": "ChatFieldResult.FormType",
                    "matchType": "equals",
                    "value": [
                        "2"
                    ]
                }
            ]
        }
    ],
    "mergeType": "row",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "series": [
        {
            "campaignId": "92a816a9-b590-493d-9bf4-98c921c4f40c",
            "campaignName": "Comm100 Website Bussiness",
            "count": "2.0",
            "option": "No",
            "type": "6",
            "fieldId": "420758aa-ea68-4bf2-91ae-86a865641fd0",
            "fieldName": "Did you get a timely response from the agent?"
        },
        //...
    ]
  } 

Pre-chat Survey

Provides insight on visitor data collected from pre-chat surveys.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "campaignId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Id",
                    "conditions": []
                },
                {
                    "name": "campaignName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Name",
                    "conditions": []
                },
                {
                    "name": "count",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "option",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "type",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Type",
                    "conditions": []
                },
                {
                    "name": "fieldId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Id",
                    "conditions": []
                },
                {
                    "name": "fieldName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Name",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "campaignId",
                    "fieldName": "CampaignId",
                    "isFull": false
                },
                {
                    "name": "fieldId",
                    "fieldName": "ChatFieldResult.FieldId",
                    "isFull": false
                },
                {
                    "name": "option",
                    "fieldName": "ChatFieldResult.Value",
                    "isFull": false
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/04/28",
                        "2021/05/27"
                    ]
                },
                {
                    "fieldName": "ChatFieldResult.Field.Type",
                    "matchType": "equals",
                    "value": [
                        "3",
                        "4",
                        "5",
                        "6"
                    ]
                },
                {
                    "fieldName": "ChatFieldResult.FormType",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        }
    ],
    "mergeType": "row",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "series": [
        {
            "campaignId": "92a816a9-b590-493d-9bf4-98c921c4f40c",
            "campaignName": "Comm100 Website",
            "count": "2.0",
            "option": "Sales",
            "type": "5",
            "fieldId": "dcf659f4-ae18-4534-8c00-98f10b7b28c4",
            "fieldName": "Inquiry Related"
        },
        //...
    ]
  } 

Chat Wrap-up

Shows the categorization details of the chats as well as the wrap-up completion rate according to the wrap-up survey.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "campaignId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Id",
                    "conditions": []
                },
                {
                    "name": "campaignName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Name",
                    "conditions": []
                },
                {
                    "name": "count",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "categoryOptionId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatWrapupCategory.CategoryOption.Id",
                    "conditions": []
                },
                {
                    "name": "categoryOptionName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatWrapupCategory.CategoryOption.Name",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "campaignId",
                    "fieldName": "CampaignId",
                    "isFull": false
                },
                {
                    "name": "optionId",
                    "fieldName": "ChatWrapupCategory.CategoryOptionId",
                    "isFull": false
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/03",
                        "2021/06/01"
                    ]
                }
            ]
        },
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "campaignId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Id",
                    "conditions": []
                },
                {
                    "name": "campaignName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "Campaign.Name",
                    "conditions": []
                },
                {
                    "name": "count",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "option",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "type",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Type",
                    "conditions": []
                },
                {
                    "name": "fieldId",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Id",
                    "conditions": []
                },
                {
                    "name": "fieldName",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "ChatFieldResult.Field.Name",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "campaignId",
                    "fieldName": "CampaignId",
                    "isFull": false
                },
                {
                    "name": "fieldId",
                    "fieldName": "ChatFieldResult.FieldId",
                    "isFull": false
                },
                {
                    "name": "option",
                    "fieldName": "ChatFieldResult.Value",
                    "isFull": false
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/05/03",
                        "2021/06/01"
                    ]
                },
                {
                    "fieldName": "ChatFieldResult.Field.Type",
                    "matchType": "equals",
                    "value": [
                        "3",
                        "4",
                        "5",
                        "6"
                    ]
                },
                {
                    "fieldName": "ChatFieldResult.FormType",
                    "matchType": "equals",
                    "value": [
                        "3"
                    ]
                }
            ]
        }
    ],
    "mergeType": "row",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "series": [
        {
            "campaignId": "08382335-e771-4bcc-9ad2-33d2422aba20",
            "campaignName": "1kellyc",
            "count": 1.0,
            "categoryOptionId": "f29ba660-bdeb-4d0f-8a36-acc500d8201f",
            "categoryOptionName": "ccccc"
        },
        //...
    ]
  } 

Conversions

Shows all achieved conversions, total conversion value and the conversion rate.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "ConversionLog",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "conversions",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "convertedVisitors",
                    "calculationType": "uniqueCount",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "VisitorId",
                    "conditions": []
                },
                {
                    "name": "convertedChattedVisitors",
                    "calculationType": "uniqueCount",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "VisitorId",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "ChatIdNotEmpty",
                            "fieldName": "ChatGuid",
                            "operate": "notEquals",
                            "values": [
                                "00000000-0000-0000-0000-000000000000"
                            ]
                        }
                    ]
                },
                {
                    "name": "convRateOfChattedVisitors",
                    "calculationType": "expression",
                    "valueType": "percent",
                    "expression": "convertedChattedVisitors/chattedVisitors",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "value",
                    "calculationType": "sum",
                    "valueType": "decimal",
                    "expression": "",
                    "fieldName": "ConversionValue",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "CreatedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                }
            ]
        },
        {
            "name": "Chat",
            "fields": [
                {
                    "name": "chats",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "chattedVisitors",
                    "calculationType": "uniqueCount",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Session.VisitorId",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "RequestedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "RequestedTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                },
                {
                    "fieldName": "Status",
                    "matchType": "equals",
                    "value": [
                        "0"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "conversions": 540,
        "convertedVisitors": 93,
        "convertedChattedVisitors": 14,
        "value": 420.0,
        "chats": 333,
        "chattedVisitors": 76,
        "convRateOfChattedVisitors": 18.42
    },
    "series": [
        {
            "time": "2021-02-01",
            "conversions": 21.0,
            "convertedVisitors": 2.0,
            "convertedChattedVisitors": 1.0,
            "convRateOfChattedVisitors": 50.0,
            "value": 0.0,
            "chats": 2.0,
            "chattedVisitors": 2.0
        },
        //...
    ]
  } 

Manual Invitation

Shows the number of invitations sent manually by agents as well as the acceptance rate.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "ManualInvitationLog",
            "fields": [
                {
                    "name": "sent",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status0",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "0"
                            ]
                        }
                    ]
                },
                {
                    "name": "accepted",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "Status1",
                            "fieldName": "Status",
                            "operate": "equals",
                            "values": [
                                "1"
                            ]
                        }
                    ]
                },
                {
                    "name": "acceptanceRate",
                    "calculationType": "expression",
                    "valueType": "percent",
                    "expression": "accepted/sent",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "sumInvitation",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Status",
                    "conditions": []
                },
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "SentTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "SentTime",
                    "matchType": "between",
                    "value": [
                        "2021/02/01",
                        "2021/03/01"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "sent": 16,
        "accepted": 9,
        "sumInvitation": 25,
        "acceptanceRate": 56.25
    },
    "series": [
        {
            "time": "2021-02-01",
            "sent": 0,
            "accepted": 0,
            "acceptanceRate": 0.0,
            "sumInvitation": 0
        },
        //...
    ]
  } 

Auto Invitation

Shows the number of invitations triggered by predefined rules as well as the acceptance rate.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "AutoInvitationStatistics",
            "fields": [
                {
                    "name": "sent",
                    "calculationType": "sum",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "SentNum",
                    "conditions": []
                },
                {
                    "name": "accepted",
                    "calculationType": "sum",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "AcceptNum",
                    "conditions": []
                },
                {
                    "name": "acceptanceRate",
                    "calculationType": "expression",
                    "valueType": "percent",
                    "expression": "accepted/sent",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "LogTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "LogTime",
                    "matchType": "between",
                    "value": [
                        "2021/03/01",
                        "2021/03/31"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "sent": 5,
        "accepted": 2,
        "acceptanceRate": 40.0
    },
    "series": [
        {
            "time": "2021-03-01",
            "sent": 0,
            "accepted": 0,
            "acceptanceRate": 0.0
        },
        //...
    ]
  } 

Offline Message

Provides details on the number of offline messages left by the visitos as well as their source.

Sample Request:

curl https://api11.comm100.io/v4/reportingquery/reports/query \ 
-X 'POST' \ 
-H 'Authorization: Bearer {access_token}' \ 
-H 'Content-Type: application/json' \ 
-D '{
    "cubeEntities": [
        {
            "name": "OfflineMessage",
            "fields": [
                {
                    "name": "time",
                    "calculationType": "originalValue",
                    "valueType": "string",
                    "expression": "",
                    "fieldName": "",
                    "conditions": []
                },
                {
                    "name": "fromOfflineButton",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Source",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "SourceOffline",
                            "fieldName": "Source",
                            "operate": "equals",
                            "values": [
                                "0",
                                "1",
                                "2"
                            ]
                        }
                    ]
                },
                {
                    "name": "messages",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Id",
                    "conditions": []
                },
                {
                    "name": "fromChatQueue",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Source",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "SourceQueue",
                            "fieldName": "Source",
                            "operate": "equals",
                            "values": [
                                "3"
                            ]
                        }
                    ]
                },
                {
                    "name": "fromBot",
                    "calculationType": "count",
                    "valueType": "int",
                    "expression": "",
                    "fieldName": "Source",
                    "conditionMatchType": "all",
                    "conditions": [
                        {
                            "name": "SourceBot",
                            "fieldName": "Source",
                            "operate": "equals",
                            "values": [
                                "4"
                            ]
                        }
                    ]
                }
            ],
            "rowGroups": [
                {
                    "name": "time",
                    "fieldName": "CreatedTime",
                    "isFull": true,
                    "timeDisplayType": "day"
                }
            ],
            "filters": [
                {
                    "fieldName": "CreatedTime",
                    "matchType": "between",
                    "value": [
                        "2021/03/01",
                        "2021/03/31"
                    ]
                }
            ]
        }
    ],
    "mergeType": "column",
    "timezone": "Pacific Standard Time"
}' 

Response:

HTTP/1.1 200 OK

{
    "total": {
        "fromOfflineButton": 4,
        "messages": 4,
        "fromChatQueue": 0,
        "fromBot": 0
    },
    "series": [
        {
            "time": "2021-03-01",
            "fromOfflineButton": 0,
            "messages": 0,
            "fromChatQueue": 0,
            "fromBot": 0
        },
        //...
    ]
  } 

Was this article helpful?

What's Next