NAV
Version: 1.0.0
GraphQL cURL

Introduction

TVox provides standard reporting and a set of insights dashboards that allow monitoring of the service levels and occupation of Contact Center resources.

TVox Data Model responds the need to create customized reports or dashboards (for example integrating CRM data) by providing access to the TVox Contact Center statistical data.

TVox Data Model consists in:

Statistical data covers channels:

Requirements

API Reference

Overview

TVox Data Model API provides access to statistical data through Web requests.

Endpoint for requests is constructed as follows:

https://<TVOX_HOST>/datamodel/query

The API is build on GraphQL query language, which allows you to request exactly the information you need with a simple and intuitive syntax.

GraphQL Glossary

Below a short GraphQL glossary of the main terms used in reference to the example on the right, reporting a basic GraphQL query for retrieving some users info searching them by name.

# Query "users" searches for users with name equal to "John"
# and displays their name, surname and address (street and city)
query {
  users(searchName: "John") {
    name
    surname
    address {
      street
      city
    }
  }
}
Term Description Example
Query Operation type defining a single data request query
Operation Function that retrieves requested data users
Argument Condition to filter, paginate and sort requested data searchName
Field Value that rapresents requested data name, surname, address (street and city are defined as fields of address)

Request

TVox Data Model API allows GET or POST requests over HTTPS protocol.

GET request

In GET request the query must be passed as value of the query parameter.

query {
  me {
    name
  }
}

Example:

https://<TVOX_HOST>/datamodel/query?query={me{name}}

POST request

POST request should use the application/json content type, and include a JSON-encoded body of the following form:

{ "query": "{me{name}}" }

Response

Regardless of the method by which the request was sent, the response is returned in the body of the request in JSON format. A query might result in some data and some errors, and those are returned in a JSON object of the form:

{ "data": { ... }, "errors": [ ... ] }

If there were no errors returned, the errors field is not be present on the response. If no data is returned the data field is only be included if the error occurred during execution.

Authentication

TVox Data Model provides authentication via API Key, provided by Telenia Software.
To authenticate requests it is necessary to have an X-Telenia-APIKey header:

X-Telenia-APIKey: <YOUR_APIKEY>

Rate Limit

Requests to TVox Data Model API are subject to rate limit, i.e. a maximum number of requests that can be made within a certain time period.
The rate limit is 100 requests per minute.

Time Window

Given the nature of the statistical data that are reported by year / month, their request needs to specify the year and month in which to search the data.

Example:

search: { year: 1970, month: 1, ... }

Pagination

Statistical data can have very high cardinalities and a query without limits could lead to a reduction in server performance or, worse, to failure situations.
To avoid this, queries that include a list of elements as result are paged. This means that a limit (max: 1000) and an offset must be specified for each request.

Example:

search: { ..., pagination: { limit: 1000, offset: 0 } }

Sorting

It is possibile to return lists of elements thar are sorted (ordered) according to sort key and sort direction (ascending or descending).

Example:

search: { ..., sorting: { key: START_TIME, direction: ASC } }

Development & Testing

TVox Data Model provides an interactive web environment (Playground) for develop and testing your queries.

Playground

It can be reached at the following link:

https://<TVOX_HOST>/datamodel

The Playground consists of two main sections:

To run the query just press the play button in the center.

Authentication header can be provided in HTTP HEADER section on bottom-left as JSON object with X-Telenia-APIKey field.

{ "X-Telenia-APIKey": "<YOUR_APIKEY>" }

The Playground allows also to generate the query's cURL command as an HTTP POST request.

Testing queries in Playground is a good way to verify that your request is correct and gives you the result you expect.

Phone

Statistical data for phone channel include:

These data can be retrieved by ID, searched and counted.

Inbound Service Call

Get Inbound Service Call by ID.

Result is the list of steps that make up the requested call.

Example:

Get call with ID equals to 1588581589.1320 and of this call get id, step, start time and end time.

Inbound Service Call

query {
  inboundCall(id: "1588581589.1320") {
    id
    step
    startTime
    endTime
  }
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundCall(id: \"1588581589.1320\") {\n    id\n    step\n    startTime\n    endTime\n  }\n}"}' --compressed

Inbound Service Calls

Search Inbound Service Calls.

Argument search is the object containing search criterias.
Search criterias include time window (year, month), pagination and sorting.

Result is the list of calls that respect search criteria; each call is in turn a list of steps that make up it.

Example:

Search calls according to the following search criteria:

Inbound Service Calls

query {
  inboundCalls(
    search: {
      year: 2020
      month: 5
      pagination: { limit: 100, offset: 0 }
      sorting: { key: ID, direction: ASC }
      startTime: {
        operator: BETWEEN
        valueLeft: "2020-05-01T00:00:00Z"
        valueRight: "2020-05-15T00:00:00Z"
      }
    }
  ) {
    id
    step
    startTime
    endTime
  }
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundCalls(\n    search: {\n      year: 2020\n      month: 5\n      pagination: { limit: 100, offset: 0 }\n      sorting: { key: ID, direction: ASC }\n      startTime: {\n        operator: BETWEEN\n        valueLeft: \"2020-05-01T00:00:00Z\"\n        valueRight: \"2020-05-15T00:00:00Z\"\n      }\n    }\n  ) {\n    id\n    step\n    startTime\n    endTime\n  }\n}\n"}' --compressed

Inbound Service Calls Count

Count Inbound Service Calls.

Argument search is the object containing search criterias.
Search criterias include time window (year, month), pagination and sorting.

Result is the 32-bit postive integer counting searched calls.

Example:

Count calls according to the following search criteria:

Inbound Service Calls Count

query {
  inboundCallsCount(
    search: {
      year: 2020
      month: 5
      pagination: { limit: 100, offset: 0 }
      sorting: { key: ID, direction: ASC }
      startTime: {
        operator: BETWEEN
        valueLeft: "2020-05-01T00:00:00Z"
        valueRight: "2020-05-15T00:00:00Z"
      }
    }
  )
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundCallsCount(\n    search: {\n      year: 2020\n      month: 5\n      pagination: { limit: 100, offset: 0 }\n      sorting: { key: ID, direction: ASC }\n      startTime: {\n        operator: BETWEEN\n        valueLeft: \"2020-05-01T00:00:00Z\"\n        valueRight: \"2020-05-15T00:00:00Z\"\n      }\n    }\n  )\n}\n"}' --compressed

Video

Statistical data for video channel include:

These data can be retrieved by ID, searched and counted.

Inbound Service Video Call

Get Inbound Service Video Call by ID.

Result is the list of steps that make up the requested video call.

Example:

Get video call with ID equals to 1588581589.1320 and of this video call get id, step, start time and end time.

Inbound Service Call

query {
  inboundVideoCall(id: "1588581589.1320") {
    id
    step
    startTime
    endTime
  }
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundVideoCall(id: \"1588581589.1320\") {\n    id\n    step\n    startTime\n    endTime\n  }\n}"}' --compressed

Inbound Service Video Calls

Search Inbound Service Video Calls.

Argument search is the object containing search criterias.
Search criterias include time window (year, month), pagination and sorting.

Result is the list of video calls that respect search criteria; each video call is in turn a list of steps that make up it.

Example:

Search video calls according to the following search criteria:

Inbound Service Video Calls

query {
  inboundVideoCalls(
    search: {
      year: 2020
      month: 5
      pagination: { limit: 100, offset: 0 }
      sorting: { key: ID, direction: ASC }
      startTime: {
        operator: BETWEEN
        valueLeft: "2020-05-01T00:00:00Z"
        valueRight: "2020-05-15T00:00:00Z"
      }
    }
  ) {
    id
    step
    startTime
    endTime
  }
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundVideoCalls(\n    search: {\n      year: 2020\n      month: 5\n      pagination: { limit: 100, offset: 0 }\n      sorting: { key: ID, direction: ASC }\n      startTime: {\n        operator: BETWEEN\n        valueLeft: \"2020-05-01T00:00:00Z\"\n        valueRight: \"2020-05-15T00:00:00Z\"\n      }\n    }\n  ) {\n    id\n    step\n    startTime\n    endTime\n  }\n}\n"}' --compressed

Inbound Service Video Calls Count

Count Inbound Service Video Calls.

Argument search is the object containing search criterias.
Search criterias include time window (year, month), pagination and sorting.

Result is the 32-bit postive integer counting searched video calls.

Example:

Count video calls according to the following search criteria:

Inbound Service Calls Count

query {
  inboundVideoCallsCount(
    search: {
      year: 2020
      month: 5
      pagination: { limit: 100, offset: 0 }
      sorting: { key: ID, direction: ASC }
      startTime: {
        operator: BETWEEN
        valueLeft: "2020-05-01T00:00:00Z"
        valueRight: "2020-05-15T00:00:00Z"
      }
    }
  )
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundVideoCallsCount(\n    search: {\n      year: 2020\n      month: 5\n      pagination: { limit: 100, offset: 0 }\n      sorting: { key: ID, direction: ASC }\n      startTime: {\n        operator: BETWEEN\n        valueLeft: \"2020-05-01T00:00:00Z\"\n        valueRight: \"2020-05-15T00:00:00Z\"\n      }\n    }\n  )\n}\n"}' --compressed

Chat

Statistical data for chat channel include:

These data can be retrieved by ID, searched and counted.

Inbound Service Chat

Get Inbound Service Chat by ID.

Result is the list of steps that make up the requested chat.

Example:

Get chat with ID equals to 1588581589.1320 and of this chat get id, step, start time and end time.

Inbound Service Call

query {
  inboundChat(id: "1588581589.1320") {
    id
    step
    startTime
    endTime
  }
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundChat(id: \"1588581589.1320\") {\n    id\n    step\n    startTime\n    endTime\n  }\n}"}' --compressed

Inbound Service Chats

Search Inbound Service Chats.

Argument search is the object containing search criterias.
Search criterias include time window (year, month), pagination and sorting.

Result is the list of chats that respect search criteria; each chat is in turn a list of steps that make up it.

Example:

Search chats according to the following search criteria:

Inbound Service Chats

query {
  inboundChats(
    search: {
      year: 2020
      month: 5
      pagination: { limit: 100, offset: 0 }
      sorting: { key: ID, direction: ASC }
      startTime: {
        operator: BETWEEN
        valueLeft: "2020-05-01T00:00:00Z"
        valueRight: "2020-05-15T00:00:00Z"
      }
    }
  ) {
    id
    step
    startTime
    endTime
  }
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundChats(\n    search: {\n      year: 2020\n      month: 5\n      pagination: { limit: 100, offset: 0 }\n      sorting: { key: ID, direction: ASC }\n      startTime: {\n        operator: BETWEEN\n        valueLeft: \"2020-05-01T00:00:00Z\"\n        valueRight: \"2020-05-15T00:00:00Z\"\n      }\n    }\n  ) {\n    id\n    step\n    startTime\n    endTime\n  }\n}\n"}' --compressed

Inbound Service Chats Count

Count Inbound Service Chats.

Argument search is the object containing search criterias.
Search criterias include time window (year, month), pagination and sorting.

Result is the 32-bit postive integer counting searched chats.

Example:

Count chats according to the following search criteria:

Inbound Service Chats Count

query {
  inboundChatsCount(
    search: {
      year: 2020
      month: 5
      pagination: { limit: 100, offset: 0 }
      sorting: { key: ID, direction: ASC }
      startTime: {
        operator: BETWEEN
        valueLeft: "2020-05-01T00:00:00Z"
        valueRight: "2020-05-15T00:00:00Z"
      }
    }
  )
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundChatsCount(\n    search: {\n      year: 2020\n      month: 5\n      pagination: { limit: 100, offset: 0 }\n      sorting: { key: ID, direction: ASC }\n      startTime: {\n        operator: BETWEEN\n        valueLeft: \"2020-05-01T00:00:00Z\"\n        valueRight: \"2020-05-15T00:00:00Z\"\n      }\n    }\n  )\n}\n"}' --compressed

Schema Types

This section documents the schema types of the TVox Data Model API.

Basic knowledge

Syntax Description
Type! Type object is required
[Type] List of Type objects
[Type]! List of Type objects where at least one element is required, but this element can be null
[Type!]! List of Type objects where at least one element is required and this element can not be null

Query

List of queries to retrieve statistical data.

Field Argument Type Description
inboundCall [InboundInteraction!] Get Inbound Service Call by ID. Result is the list of steps that make up the requested call.
id String!
inboundCalls [[InboundInteraction!]!]! Search Inbound Service Calls. Argument `search` is the object containing search criterias. Search criterias include time window (year, month), pagination and sorting. Result is the list of calls that respect search criteria; each call is in turn a list of steps that make up it.
search SearchInteraction!
inboundCallsCount Int! Count Inbound Service Calls. Argument `search` is the object containing search criterias. Search criterias include time window (year, month), pagination and sorting. Result is the 32-bit postive integer counting searched calls.
search SearchInteraction!
inboundVideoCall [InboundInteraction!] Get Inbound Service Video Call by ID. Result is the list of steps that make up the requested video call.
id String!
inboundVideoCalls [[InboundInteraction!]!]! Search Inbound Service Video Calls. Argument `search` is the object containing search criterias. Search criterias include time window (year, month), pagination and sorting. Result is the list of video calls that respect search criteria; each video call is in turn a list of steps that make up it.
search SearchInteraction!
inboundVideoCallsCount Int! Count Inbound Service Video Calls. Argument `search` is the object containing search criterias. Search criterias include time window (year, month), pagination and sorting. Result is the 32-bit postive integer counting searched video calls.
search SearchInteraction!
inboundChat [InboundInteraction!] Get Inbound Service Chat by ID. Result is the list of steps that make up the requested chat.
id String!
inboundChats [[InboundInteraction!]!]! Search Inbound Service Chats. Argument `search` is the object containing search criterias. Search criterias include time window (year, month), pagination and sorting. Result is the list of chats that respect search criteria; each chat is in turn a list of steps that make up it.
search SearchInteraction!
inboundChatsCount Int! Count Inbound Service Chats. Argument `search` is the object containing search criterias. Search criterias include time window (year, month), pagination and sorting. Result is the 32-bit postive integer counting searched chats.
search SearchInteraction!
advancedQuery [OrderedMap!]! Advanced query for channels: **phone**, **video** and **chat**. See the complete documentation for model details and query limitations. Argument `query` is a string containing the advanced query to be executed. Update, insert or delete actions are not allowed. Result is represented by a list of objects where the keys are the names of the selected fields and values are strings.
query String!

Objects

CallResult

The CallResult type represents call result data

Field Argument Type Description
resultLevel1 String 1st level call result (exit code)
resultLevel2 String 2nd level call result (exit code)
note1 String 1st level call result (exit code) note
note2 String 2nd level call result (exit code) note

CallTag

The CallTag type represents call tagging data

Field Argument Type Description
note1 String 1st call tagging note
note2 String 2nd call tagging note

Contact

The Contact type represents contact data

Field Argument Type Description
id String Contact UUID
username String Contact username (if internal of type "USER")
value String Contact value (e.g. phone number)
type ContactType Contact type
lookupType ContactLookupType Contact lookup result type

GenericFields

The GenericFields type represents generic fields data

Field Argument Type Description
generic1 String Generic custom data 1
generic2 String Generic custom data 2
generic3 String Generic custom data 3
generic4 String Generic custom data 4
generic5 String Generic custom data 5

InboundInteraction

The InboundInteraction type represents a single inbound interaction step (call, video call and chat).

Field Argument Type Description
id String! Unique identifier
step Int! Number of the interaction step. Each interaction can be composed of several steps (N), sorted from the most recent (0) to the oldest (N-1).
user String User's username
exten String User's logged exten
SIPChannel String SIP channel identifier
skillset String Skillset code
cli String Caller Line Identification (Calling number)
dnis String Direct Number Information System (Called number)
startTime Time Start time
distributionTime Time Distribution time
status Status Status
transferedTo TransferTo Service or number to which the interaction was transferred
answerByUserTime Time Answer time by user
waitDurationOnUser Int! Ringing time on user
durationOnUser Int! Connection time with user
endTime Time End time
waitDuration Int! Waiting duration time in IVR
totalDuration Int! Total duration time in the system
service String Service code
popup Popup Popup
context Context Time context
SIPCallId String SIP call identifier (only for calls)
customer String Customer code
servicePriority Int! Service priority
multiChannel MultiChannel! Multichannel
IVRLabel String IVR node label
interviewService String Interview (Survey) service code
smartrec String Recording file (only for calls)
data String Additional data
queueTime Time Queueing time
queueDuration Int! Queueing duration time
wnrOnUserTime Time WNR (after interaction work) time
wnrDurationOnUser Int! WNR (after interaction work) duration time
callResult CallResult Call result (exit code)
holdDuration Int! Hold duration time on user
callTag CallTag Call tagging
channelDestination ChannelDestinationType Channel destination of transfer
sentiment Int! Customer sentiment code
contact Contact Contact
censusResult String Contact censur result
abandonedCall String Linked abandoned call id
callbackCall String Linked callback call id
generic GenericFields Generic custom data
lastUpdateTime Time! Last update time

MultiChannel

The MultiChannel type represents multichannel data

Field Argument Type Description
type MultiChannelType! Multichannel type
session String Multichannel session id
text String Multichannel additional data
description String Multichannel description

The Popup type represents popup data

Field Argument Type Description
type PopupType! Popup type (EXE or WEB)
result String Popup result
info String Additional information collected by IVR or third party applications. The individual information is separated by the special character "|".

TransferTo

The TransferTo type represents transfer destination data

Field Argument Type Description
type TransferToType! Transfer destination type (service or number)
value String! Transfer destination value (service code or phone number)

Inputs

ComparisonDuration

The ComparisonDuration type represents comparison between duration values.

Field Type Description
operator ComparisonTimeOperator Operator to compare duration values
value Int Duration value to compare
valueLeft Int Duration value used as left term in bynary comparison
valueRight Int Duration value used as right term in bynary comparison

ComparisonString

The ComparisonString type represents comparison between string values.

Field Type Description
operator ComparisonStringOperator Operator to compare string values
value [String!] List of string values to compare
regexp String Regular expression to match

ComparisonTime

The ComparisonTime type represents comparison between time values.

Field Type Description
operator ComparisonTimeOperator Operator to compare time values
value Time Time value to compare
valueLeft Time Time value used as left term in bynary comparison
valueRight Time Time value used as right term in bynary comparison

Pagination

The Pagination type represents pagination.

Field Type Description
limit Int Maximum number of element to retrieve
offset Int Offset of the first element to retrieve (starting from 0)

SearchCallResult

The SearchCallResult type represents search criteria for call result.

Field Type Description
resultLevel1 ComparisonString String values comparison for call result (level 1)
resultLevel2 ComparisonString String values comparison for call result (level 2)
note1 ComparisonString String values comparison for call result note (level 1)
note2 ComparisonString String values comparison for call result note (level 2)

SearchCallTag

The SearchCallTag type represents search criteria for call tag.

Field Type Description
note1 ComparisonString String values comparison for call tag note 1
note2 ComparisonString String values comparison for call tag note 2

SearchContact

The SearchContact type represents search criteria for contact.

Field Type Description
id ComparisonString String values comparison for contact id
username ComparisonString String values comparison for contact username
value ComparisonString String values comparison for contact value
type [ContactType!] List of contact types to search
lookupType [ContactLookupType!] List of contact lookup types to search

SearchGenericFields

The SearchGenericFields type represents search criteria for generic fields.

Field Type Description
generic1 ComparisonString String values comparison for generic field 1
generic2 ComparisonString String values comparison for generic field 2
generic3 ComparisonString String values comparison for generic field 3
generic4 ComparisonString String values comparison for generic field 4
generic5 ComparisonString String values comparison for generic field 5

SearchInteraction

The SearchInteraction type represents search criterias for interactions (calls, video calls and chats).

Field Type Description
year Int Year in which to search interactions
month Int Month in which to search interactions
pagination Pagination Pagination (limit and offset)
sorting SortingInboundInteraction Sorting (key and direction)
id ComparisonString String values comparison for id
step Step Interaction step to retrieve (last or all)
user ComparisonString String values comparison for user
exten ComparisonString String values comparison for exten
SIPChannel ComparisonString String values comparison for SIP channel
skillset ComparisonString String values comparison for skillset
cli ComparisonString String values comparison for cli
dnis ComparisonString String values comparison for dnis
startTime ComparisonTime Time values comparison for start time. The comparison is applied on year, month and day, not taking into account hours, minutes and seconds.
distributionTime ComparisonTime Time values comparison for distribution time The comparison is applied on year, month and day, not taking into account hours, minutes and seconds.
status [Status!] List of statuses to search
transferedTo SearchTransferTo Search criteria for transfer destination
answerByUserTime ComparisonTime Time values comparison for answer by user time The comparison is applied on year, month and day, not taking into account hours, minutes and seconds.
waitDurationOnUser ComparisonDuration Duration values comparison for wait duration on user
durationOnUser ComparisonDuration Duration values comparison for duration on user
endTime ComparisonTime Time values comparison for end time The comparison is applied on year, month and day, not taking into account hours, minutes and seconds.
waitDuration ComparisonDuration Duration values comparison for wait duration
totalDuration ComparisonDuration Duration values comparison for total duration
service ComparisonString String values comparison for service
popup SearchPopup Search criteria for popup
context [Context!] List of contexts to search
SIPCallId ComparisonString String values comparison for SIP call id
customer ComparisonString String values comparison for customer
servicePriority [Int!] List of service priorities (integers) to search
multiChannel SearchMultiChannel Search criteria for multichannel
IVRLabel ComparisonString String values comparison for IVR label
interviewService ComparisonString String values comparison for interview service
smartrec ComparisonString String values comparison for smartrec
data ComparisonString String values comparison for data
queueTime ComparisonTime Time values comparison for queue time The comparison is applied on year, month and day, not taking into account hours, minutes and seconds.
queueDuration ComparisonDuration Duration values comparison for queue duration
wnrOnUserTime ComparisonTime Time values comparison for wnr (after interaction work) on user time The comparison is applied on year, month and day, not taking into account hours, minutes and seconds.
wnrDurationOnUser ComparisonDuration Duration values comparison for wnr (after interaction work) duration on user
callResult SearchCallResult Search criteria for call result
holdDuration ComparisonDuration Duration values comparison for hold duration
callTag SearchCallTag Search criteria for call tag
channelDestination [ChannelDestinationType!] List of channel destination types to search
sentiment [Int!] List of sentiment values (integers) to search
contact SearchContact Search criteria for contact
censusResult ComparisonString String values comparison for census result
abandonedCall Boolean Has or not a linked abandoned call
callbackCall Boolean Has or not a linked callback call
generic SearchGenericFields Search criteria for generic fields
lastUpdateTime ComparisonTime Time values comparison for last update time

SearchMultiChannel

The SearchMultiChannel type represents search criteria for multichannel.

Field Type Description
session ComparisonString String values comparison for multichannel session
text ComparisonString String values comparison for multichannel text
description ComparisonString String values comparison for multichannel description

SearchPopup

The SearchPopup type represents search criteria for popup.

Field Type Description
type [PopupType!] List of popup types to search
result ComparisonString String values comparison for popup result
info ComparisonString String values comparison for popup info

SearchTransferTo

The SearchTransferTo type represents search criteria for transfer destination.

Field Type Description
type [TransferToType!] List of transfer destination types to search
value ComparisonString String values comparison for value

SortingInboundInteraction

The SortingInboundInteraction type represents sorting for inbound interactions (calls, video calls and chats).

Field Type Description
key SortKeyInboundInteraction Key for sorting inbound interactions
direction SortDirection Direction for sorting inbound interactions

Enums

ChannelDestinationType

The ChannelDestinationType enum represents the channel destination type of transfer.

Value Description
INTERNAL Internal
EXTERNAL External
REMOTE Remote

ComparisonStringOperator

The ComparisonStringOperator enum represents operator to compare string values.

Value Description
NULL String value is 'null'.
EMPTY String value is empty.
NOT_NULL String value is not 'null'.
NOT_EMPTY String value is not empty.
EQUAL String value is equal to at least one value of list field "value" of "ComparisonString" type.
NOT_EQUAL String value is not equal to at least one value of list field "value" of "ComparisonString" type.
CONTAIN String value is contained into at least one value of list field "value" of "ComparisonString" type.
START_WITH String value is the initial part of at least one value of list field "value" of "ComparisonString" type.
END_WITH String value is the end of at least one value of list field "value" of "ComparisonString" type.
REGEXP String value matches the regular expression in field "regexp" of "ComparisonString" type.

ComparisonTimeOperator

The ComparisonTimeOperator enum represents operator to compare time values.

Value Description
GREATER_THAN Time value is greater than or equals to equal to field "value" of "ComparisonTime" type.
LESSER_THAN Time value is lesser than or equals to equal to field "value" of "ComparisonTime" type.
BETWEEN Time value is between field "valueLeft" and field "valueRight" of "ComparisonTime" type.

ContactLookupType

The ContactLookupType enum represents contact lookup type.

Value Description
SUCCESS Single contact lookup
MULTIPLE Multiple contact lookup
NONE No contact lookup
ERROR Error in contact lookup

ContactType

The ContactType enum represents contact type.

Value Description
USER Internal user contact
SERVICE Service contact
SHORT_NUMBER Short number contact
EXTERNAL_ITEM External contact
EXTERNAL_ORGANIZATION External organization contact
PERSONAL_ITEM Personal contact
UNKNOWN Unknown contact
ANONYMOUS Anonymous contact

Context

The Context enum represents the time context of interaction.

Value Description
ACTIVE Active
OUT_OF_SERVICE Out of service
OUT_OF_CALENDAR Out of calendar
CUSTOM_1 Custom context 1
CUSTOM_2 Custom context 2
CUSTOM_3 Custom context 3
CUSTOM_4 Custom context 4
CUSTOM_5 Custom context 5

MultiChannelType

The MultiChannelType enum represents multichannel type.

Value Description
CALL Call / Phone channel
GENERIC_1 Custom generic channel 1
GENERIC_2 Custom generic channel 2
GENERIC_3 Custom generic channel 3
VIDEO Video channel
MAIL Mail / Support channel
LIVEHELP LiveHelp channel
CHAT Chat channel

PopupType

The PopupType enum represents popup type.

Value Description
EXE Executable popup
WEB Web popup

SortDirection

The SortKeyInboundInteraction enum represents sort direction for inbound interactions search.

Value Description
ASC Ascending direction
DESC Descending direction

SortKeyInboundInteraction

The SortKeyInboundInteraction enum represents sort key for inbound interactions search.

Value Description
ID Unique identifier
USER User's username
EXTEN User's logged exten
SIP_CHANNEL SIP channel identifier
SKILLSET Skillset code
CLI Caller Line Identification (Calling number)
DNIS Direct Number Information System (Called number)
START_TIME Start time
DISTRIBUTION_TIME Distribution time
ANSWER_BY_USER_TIME Answer time by user
WAIT_DURATION_ON_USER Ringing time on user
DURATION_ON_USER Connection time with user
END_TIME End time
WAIT_DURATION Waiting duration time in IVR
TOTAL_DURATION Total duration time in the system
SERVICE Service code
POPUP_TYPE Popup type
CONTEXT Time context
SIP_CALL_ID SIP call identifier (only for calls)
CUSTOMER Customer code
SERVICE_PRIORITY Service priority
MULTICHANNEL_SESSION Multichannel session id
IVR_LABEL IVR node label
INTERVIEW_SERVICE Interview (Survey) service code
SMARTREC Recording file (only for calls)
DATA Additional data
QUEUE_TIME Queueing time
QUEUE_DURATION Queueing duration time
WNR_ON_USER_TIME WNR (after interaction work) time
WNR_DURATION_ON_USER WNR (after interaction work) duration time
CALL_RESULT_LEVEL_1 1st level of call result (exit code)
CALL_RESULT_LEVEL_2 2nd level of call result (exit code)
HOLD_DURATION Hold duration time on user
CALL_TAG_NOTE_1 Call tagging note 1
CALL_TAG_NOTE_2 Call tagging note 2
CHANNEL_DESTINATION Channel destination of transfer
SENTIMENT Customer sentiment code
CONTACT_ID Contact UUID
CONTACT_USERNAME Contact username (if internal of type "USER")
CONTACT_VALUE Contact value (e.g. phone number)
CONTACT_TYPE Contact type
CONTACT_LOOKUP_TYPE Contact lookup result type
CENSUS_RESULT Contact censur result
ABANDONED_CALL Linked abandoned call id
CALLBACK_CALL Linked callback call id
GENERIC_1 Generic custom data 1
GENERIC_2 Generic custom data 2
GENERIC_3 Generic custom data 3
GENERIC_4 Generic custom data 4
GENERIC_5 Generic custom data 5
LAST_UPDATE_TIME Last update time

Status

The Status enum represents the status of interaction.

Value Description
HANGUP Hanging up the caller
CLOSED_BY_SYSTEM Closed by the system
CLOSED_BY_SYSTEM_NO_SELECTION Closed by system for no selection in IVR
CLOSED_BY_SYSTEM_MAX_QUEUED_CALL_OVER Closed by system for reaching the maximum number of interactions in the queue
CLOSED_BY_SYSTEM_MAX_CALL_OVER Closed by system for reaching the maximum number of interactions
CLOSED_BY_SYSTEM_CALLBACK Closed by system for callback (phone channel)
CLOSED_WITH_TRANSFER Closed by system with transfer
ANSWERED_CLOSED_BY_CALLER Answered and closed by caller
ANSWERED_CLOSED_BY_CALLED Answered and closed by called
ANSWERED_WITH_BLIND_TRANSFER Answered and transfered (blind)
ANSWERED_WITH_CONSULTATION_TRANSFER Answered and transfered with consultation
ERROR Error

Step

The Step enum represents interaction step to return to the interaction type result.

Value Description
LAST Last step
ALL All steps

TransferToType

The TransferToType enum represents the type of transfer destination.

Value Description
SERVICE Transfer to service
NUMBER Transfer to number

Scalars

Boolean

The Boolean scalar type represents true or false.

Int

The Int scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.

OrderedMap

The OrderedMap scalar type represents a map where keys keeps an order and values are strings.

String

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Time

The Time scalar type represents date/time (RFC 3339) as string at UTC.

Advanced

Sometimes there is the need to produce data through complex queries.
To achieve this, a request can be made by directly specifying a SQL query on the available tables (described below).

Statistical data are stored in tables grouped by year / month. For example, data for May 2020 can be found in <TABLE>_202005.

Result is represented by a list of objects where the keys are the names of the selected fields and values are strings.

Example:

Count received service calls on May 2020 (table: ast_calls_202005) grouped by caller number (column: cli), reporting start time (columns: datainizio and orainizio) of the latest received call.

SELECT COUNT( DISTINCT ( uniqueid )) AS total, cli AS callerNumber, MAX( datainizio ) AS lastStartDate, MAX( orainizio ) AS lastStartTime FROM ast_calls_202005 GROUP BY cli;

Advanced Query

query {
  advancedQuery(query: "SELECT COUNT( DISTINCT ( uniqueid )) AS total, cli AS callerNumber, MAX( datainizio ) AS lastStartDate, MAX( orainizio ) AS lastStartTime FROM ast_calls_202005 GROUP BY cli;")
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  advancedQuery(query: \"SELECT COUNT( DISTINCT ( uniqueid )) AS total, cli AS callerNumber, MAX( datainizio ) AS lastStartDate, MAX( orainizio ) AS lastStartTime FROM ast_calls_202005 GROUP BY cli;\")\n}\n"}' --compressed

The advanded query can be applied on:

Inbound Service Interactions

Table: ast_calls_yyyymm

Keys: idlastcall, step

Field Type Description Note Default
idchiamata varchar(20) *
sito_distribuzione varchar(10) *
pin varchar(255) Agent username
priorita_agente int(11) Agent priority
interno varchar(100) Agent logged exten
tipochiamata char(1) Type (direction) I alias Inbound
canale varchar(50) SIP channel identifier
skillset varchar(30) Skillset code
cli varchar(255) Caller Line Identification (Calling number) Only for Phone channel
dnis varchar(255) Direct Number Information System (Called number) Only for Phone channel
datainizio date Start date
orainizio varchar(7) Start time NB: hour format is hh,mmss
datadistribuzione date Distribution date
oradistribuzione varchar(7) Distribution time NB: hour format is hh,mmss
stato_cc varchar(30) Type code
statochiamata varchar(3) Status code Possible values: H - Hanging up the caller, T - terminated by the system, TT - ended with transfer (see column "Transferred to"), RC - agent response and ended by the caller, RA - response from agent and ended by agent, RTB - answer and ended by transferring without consultation (Blind), RTC - answer and ended by transferring with consultation (Attended), E - reportion error for the call
trasferita varchar(30) Number or service code it has been transfered to
datarispostaag1 date Answer date by agent
orarispostaag1 varchar(7) Answer time by agent NB: hour format is hh,mmss
attesaag1 int(6) Ringing time on agent
durataag1 int(6) Connection time with agent
datadisconnessione date End date
oradisconnessione varchar(7) End time NB: hour format is hh,mmss
durataattesa int(6) Waiting duration time in IVR
duratacomplessiva int(6) Total duration time in the system
servizio varchar(50) Service code
grpservizio varchar(1020) List of services crossed involved by the call
popuptype enum Popup Type EXE,WEB
popupresult text Popup result (if expected)
popupinfo varchar(1000) Additional information collected by IVR or third party applications The individual information is separated by the special character "|"
idlastcall varchar(100) * composed by uniqueid@sito
sito varchar(10) *
uniqueid varchar(50) Unique identifier of the call unixtimestamp followed by an incremental number separated by "."
priorita int(20) unsigned *
contesto varchar(3) Time context AT attivo, FO fuori orario, OS fuori servizio
sipcallid varchar(255) SIP call identifier
accodamento text *
cliente varchar(20) Customer code
prior_serv int(3) Service priority
step tinyint(1) unsigned Step
FdO tinyint(1) *
pid int(11) *
contatore int(11) unsigned *
mc_id int(11) unsigned Multichannel channel id 0 = Phone Channel, 1001 = Video Channel, 1002 = Support Channel, 1003 = LiveHelp Chat Channel, 1004 = Widget Chat channel, 1, 2, 3 for optional custom channel
mc_session varchar(100) Multichannel session id
mc_text text Multichannel additional data
mc_description varchar(255) Multichannel description
ivr_label text IVR node label present if configured
interview_service varchar(50) Survey service code
smartrec varchar(255) *
calldata varchar(1024) Additional data
data_coda date Starting queuing date
ora_coda varchar(7) Queuing time NB: hour format is hh,mmss
data_wnr_ag1 date After call work date
ora_wnr_ag1 varchar(7) After call work time NB: hour format is hh,mmss
durata_wnr_ag1 int(6) After call work duration time
durata_coda int(6) Queuing duration time
callresult_result varchar(100) Exit code id
callresult_result_level_2 varchar(100) Second level exit code id
callresult_note1 text Optional Exit code note
callresult_note2 text Optional Exit code note
durata_hold int(11) Hold duration time on agent
calltag_note1 varchar(512) Optional tagging note
calltag_note2 varchar(512) Optional tagging note
channel_destination enum Transfer destination INTERNAL, EXTERNAL, REMOTE
ccbs_user_monitor char(50) *
ccbs_result enum * DEFAULT, CHANUNAVAIL, CONGESTION, NOANSWER, BUSY, ANSWER, CANCEL, DONTCALL, TORTURE, INVALIDARGS, ERROR
call_transfer_from_service char(30) *
sentiment int(11) Customer sentiment code
contact_id varchar(40) Contact identifier UUID read from t4you
contact_username varchar(255) Contact username (if internal)
contact_value varchar(255) Contact value
contact_type enum Contact type USER, SERVICE, SHORT_NUMBER, EXTERNAL_ITEM, EXTERNAL_ORGANIZATION, PERSONAL_ITEM, UNKNOWN, ANONYMOUS
contact_lookup_type enum Contact lookup result SUCCESS, MULTIPLE, NONE, ERROR
census_result varchar(100) Contact census result
access_list int(10) unsigned *
abandoned_call_id char(36) Abandoned call id
callback_call_id char(36) Callback call id
generico1 varchar(255) Generic custom data
generico2 varchar(255) Generic custom data
generico3 varchar(255) Generic custom data
generico4 varchar(255) Generic custom data
generico5 varchar(255) Generic custom data
update_time timestamp Last update timestamp

Outbound Service Interactions

Table: ast_calls_outbound_yyyymm

Keys: idlastcall, step

Field Type Description Note Default
idchiamata varchar(20) *
sito_distribuzione varchar(10) *
pin varchar(255) Agent username
priorita_agente int(11) Agent priority
interno varchar(100) Agent logged exten
tipochiamata char(1) Type (direction) O alias Outbound
canale varchar(50) SIP channel identifier
skillset varchar(30) Skillset code
cli varchar(255) Caller Line Identification (Calling number)
dnis varchar(255) Direct Number Information System (Called number)
datainizio date Start date
orainizio varchar(7) Start time NB: hour format is hh,mmss
datadistribuzione date Distribution date
oradistribuzione varchar(7) Distribution time NB: hour format is hh,mmss
stato_cc varchar(30) Type code
statochiamata varchar(3) Status code Possible values: H - Hanging up the caller, T - terminated by the system, TT - ended with transfer (see column "Transferred to"), RC - agent response and ended by the caller, RA - response from agent and ended by agent, RTB - answer and ended by transferring without consultation (Blind), RTC - answer and ended by transferring with consultation (Attended), E - reportion error for the call
trasferita varchar(30) Number or service code it has been transfered to
datarispostaag1 date Answer date by agent
orarispostaag1 varchar(7) Answer time by agent NB: hour format is hh,mmss
attesaag1 int(6) Ringing time on agent
durataag1 int(6) Connection time with agent
datadisconnessione date End date
oradisconnessione varchar(7) End time NB: hour format is hh,mmss
durataattesa int(6) Waiting duration time in IVR
duratacomplessiva int(6) Total duration time (in system)
servizio varchar(50) Service code
grpservizio varchar(1020) List of services crossed
popuptype enum Popup Type EXE, WEB
popupresult text Popup result (if expected)
popupinfo varchar(1000) Additional information collected by IVR or third party applications The individual information is separated by the special character "|"
idlastcall varchar(100) * composed by uniqueid@sito
sito varchar(10) *
uniqueid varchar(50) Unique identifier of the call unixtimestamp followed by an incremental number separated by "."
priorita int(20) unsigned *
contesto varchar(3) Time context AT attivo, FO fuori orario, OS fuori servizio
sipcallid varchar(255) SIP call identifier
accodamento text *
cliente varchar(20) Customer code
prior_serv int(3) Service priority
step tinyint(1) unsigned Step
FdO tinyint(1) *
pid int(11) *
campagna int(11) unsigned Outbound campaign code
lista int(11) unsigned Outbound campaign list code
id_spool_record int(11) Contact id used by outbound campaign interface table
item_number_spool_record int(11) unsigned Contact number id used by outbound campaign interface table
run_id int(11) *
contact_priority int(11) *
contatore int(11) unsigned *
mc_id int(11) unsigned Multichannel channel id 0 Phone channel
mc_session varchar(100) Multichannel session id Not in use
mc_text text Multichannel additional data Not in use
mc_description varchar(255 Multichannel description Not in use
ivr_label text IVR node label
interview_service varchar(50) Survey service code
smartrec varchar(255) *
calldata varchar(1024) Additional data
data_coda date Queuing date
ora_coda varchar(7) Queuing time NB: hour format is hh,mmss
data_wnr_ag1 date After call work date
ora_wnr_ag1 varchar(7) After call work time NB: hour format is hh,mmss
durata_wnr_ag1 int(6) After call work duration time
durata_coda int(6) Queuing duration time
callresult_result varchar(100) Exit code id
callresult_result_level_2 varchar(100) Second level exit code id
callresult_note1 text Optional Exit code note
callresult_note2 text Optional Exit code note
durata_hold int(11) Hold duration time on agent
calltag_note1 varchar(512) Optional tagging note
calltag_note2 varchar(512) Optional tagging note
channel_destination enum Transfer destination INTERNAL, EXTERNAL, REMOTE
call_transfer_from_service char(30) *
sentiment int(11)
contact_id varchar(40) Contact identifier UUID read from t4you
contact_username varchar(255) Contact username (if internal)
contact_value varchar(255) Contact value
contact_type enum Contact type USER, SERVICE, SHORT_NUMBER, EXTERNAL_ITEM, EXTERNAL_ORGANIZATION, PERSONAL_ITEM, UNKNOWN, ANONYMOUS
contact_lookup_type enum Contact lookup result SUCCESS, MULTIPLE, NONE, ERROR
access_list int(10) unsigned *
abandoned_call_id char(36)
callback_call_id char(36)
generico1 varchar(255) Generic custom data
generico2 varchar(255) Generic custom data
generico3 varchar(255) Generic custom data
generico4 varchar(255) Generic custom data
generico5 varchar(255) Generic custom data
update_time timestamp Last update timestamp

Calls detail

Table: ast_cdr_YYYYMM

Keys: uniqueid, id_node

Field Type Description Note Default
uniqueid char(50) Unique call id (Unix timestamp)
id_node int(3) node id When the call is transferred, multiple records are created with the same uniqueid and increasing id_node values. The value 99 indicates the record relative to the end of the call.
subevent int(11) *
subevent_digit char(80) *
current_uniqueid char(50) *
channel varchar(255) Identification of the SIP channel related to the call
dstchannel varchar(255) Identifier of the SIP channel to which the call is transferred
datainizio timestamp Call start date
datarisposta timestamp Call answer date
clid char(80) Caller Line IDentification
user_clid char(50) Calling TVox user username
sipcallid_clid varchar(128) *
exten_type_clid enum clid exten type SIP, MCS_SIP, MCS_APP, EXTERNAL, WEBRTC
exten_clid char(50) *
access_code varchar(10) Call access code
dnis char(80) Called number = Direct Number Information Service
user_dnis char(50) Username of the called TVox user
sipcallid_dnis varchar(128) *
exten_type_dnis enum dnis exten type SIP, MCS_SIP, MCS_APP, EXTERNAL, WEBRTC
exten_dnis char(50) *
linea varchar(100) Identification code of the trunk engaged in the call
durata int(10) Total call duration
durata_costo int(10) Duration of the call that made the cost
commessa varchar(1024) *
id_centrale int(10) TVox identification code
transfer char(80) Telephone number to which the call was transferred
user_transfer char(50) Username TVox user to whom the call was transferred
privata char(50) Identifies whether a call is private
tipo char(10) Type of call 0= internal; 1= outbound; 2= inbound; 3= trunk-in-to-trunk-out; 4= trunk-out-to-trunk-out; 5= trunk-in-to-trunk-in; 9= SMS outbound; 11= FAX internal; 12= FAX outbound; 13= FAX inbound;
stato varchar(100) call status NOANSWER, BUSY, FAILED, ANSWER, SUCCESS, TIMEOUT
call_service_status varchar(100) Final call status where applicable
webrtc_status_clid enum * OK, ERROR_ICE, ERROR_DTLS, ERROR_MEDIA, ERROR_CONNECTIVITY, ERROR_BAD_MEDIA
janus_sessionid_clid varchar(128) *
janus_handleid_clid varchar(128) *
webrtc_status_dnis enum OK, ERROR_ICE, ERROR_DTLS, ERROR_MEDIA, ERROR_CONNECTIVITY, ERROR_BAD_MEDIA
janus_sessionid_dnis varchar(128) *
janus_handleid_dnis varchar(128) *
abilitazione int(10) Enable code used for the outgoing call
outbound_route int(10) Outbound rule code used for the outgoing call
auth_code char(50) Username of the user who called using the authorization code
contatore int(11) counter

IVR Calls detail

Table: ast_ivr_records_bis_yyyymm

Keys: idcall, passaggio, nodo, passo

Field Type Description Note Default
idcall varchar(50) Unique call identifier (unix timestamp)
passaggio timestamp Transit instant in the IVR node
nodo int(5) Node ID
passo int(5) Identification of the step in the node
durata int(11) Total time spent in the current node
servizio varchar(30) Service code associated with the call
ntel varchar(20) *
digit varchar(20) Any Digit selected in the current node
timeout int(1) Indicates whether the call has passed the possible timeout period in the node without making any choice
invalid int(1) Indicates whether the call registered an invalid choice among those requested in the current node
retry int(1) *
label varchar(100) *
action varchar(10) Code of the action performed on the current node
qi_evalutation varchar(100) Survey ID
qi_service varchar(30) Identification of the service associated with the survey
qi_evalutation_min varchar(100) Minimum value required by the survey
qi_evalutation_max varchar(100) Maximum value required by the survey

Callback Service Calls

Table: ast_calls_callback_yyyymm

Key: id

Field Type Description Note Default
id char(36) Record identifier
score int(11) Score of the record, determines its priority and order of display
firstCallId char(100) Id of the service call that generated the record
closeCallId char(100) Id of the incoming or outgoing call that determined closed the record
service char(30) Code of the called service
type enum * IVR, WEB
escalation_time datetime(4) *
solution_time datetime(4) *
remove_time datetime(4) *
contact_uid_generated varchar(255) Indexing support column
contact_id varchar(40) Uid of the calling contact
contact_username varchar(255) Username of the calling internal contact
contact_value varchar(255) Caller number for contacts not mapped in the address book
contact_type enum Type of the calling contact USER, SERVICE, SHORT_NUMBER, EXTERNAL_ITEM, EXTERNAL_ORGANIZATION, PERSONAL_ITEM, UNKNOWN, ANONYMOUS
contact_last_number varchar(255) Number of the user's last call
start_time datetime(4) Start time of the first callback request
last_received_time datetime(4) Instant of the last call received by the customer
last_recall_time datetime(4) Moment of the last attempt made by the operator
update_time datetime(4) Last update of the callback request
close_time datetime(4) Closing moment
owner varchar(255) Operator username that is handling the call
owner_retry int(11) Number of callback attempts made by operators
user_retry int(11) Number of callback attempts made by the contact
status enum Status of the callback request NEW, LOCKED, UNLOCKED, CLOSED
closed_result enum Reason for closing the record SUCCESS, DELETED_BY_AGENT, EXPIRED, RETRY_EXCEEDED, CONTACT_RECALL, SUCCESS_FROM_ABANDONED, DELETED_BY_AGENT_FROM_ABANDONED
last_recall_result_code varchar(100) Result of the last callback made by the operator
last_recall_owner varchar(255) Last operator who managed the record
note text Notes left by the operator

Abandoned Service Calls

Table: ast_calls_abandoned_yyyymm

Key: id

Field Type Description Note Default
id char(36) Record identifier
score int(11) Score of the record, determines its priority and order of display
firstCallId char(100) Id of the service call that generated the record
closeCallId char(100) Id of the incoming or outgoing call that determined closed the record
service char(30) Code of the called service
contact_uid_generated varchar(255) Indexing support column
contact_id varchar(40) Uid of the calling contact
contact_username varchar(255) Username of the calling internal contact
contact_value varchar(255) Caller number for contacts not mapped in the address book
contact_type enum Type of the calling contact USER, SERVICE, SHORT_NUMBER, EXTERNAL_ITEM, EXTERNAL_ORGANIZATION, PERSONAL_ITEM, UNKNOWN, ANONYMOUS
contact_last_number varchar(255) Number of the user's last call
start_time datetime(4) Start time of the first abandoned call
last_received_time datetime(4) Instant of the last call received by the customer
last_recall_time datetime(4) Moment of the last attempt made by the operator
update_time datetime(4) Last update of the abandoned call
close_time datetime(4) Closing moment
owner varchar(255) Operator username that is handling the call
owner_retry int(11) Number of callback attempts made by operators
user_retry int(11) Number of callback attempts made by the contact
status enum Status of the abandoned call NEW, LOCKED, UNLOCKED, CLOSED
closed_result enum Reason for closing the record SUCCESS, DELETED_BY_AGENT, EXPIRED, RETRY_EXCEEDED, CONTACT_RECALL, SUCCESS_FROM_CALLBACK, DELETED_BY_AGENT_FROM_CALLBACK
last_recall_result_code varchar(100) Result of the last callback made by the operator
last_recall_owner varchar(255) Last operator who managed the record
note text Notes left by the operator

Calls Recordings

Table: smartrec_yyyymm

Key: filewave

Field Type Description Note Default
data date Date of the call
ora varchar(7) Time of the call
id_sito int(11) *
codiceagente varchar(255) Agent's username
sito_agente varchar(10) *
dnis varchar(20) Direct Number Information System called number
clid varchar(20) Caller Line Identification caller number
interno varchar(32) Extension where the Agent is logged in
idchiamata int(11) *
note text Notes associated with the call
filewave varchar(255) Name of the call recording .wave file
databackup date Registration filing date
labelbackup varchar(50) Name of the registration archive
durata int(11) Duration of registration
tipo char(1) Type of call I= Inbound, O= Outbound)
dati_esterni varchar(255) Data collected by third party applications
callhandle varchar(255) Unique identifier for call
callhandle_linked varchar(255) *
servizio varchar(50) Service Code
sito_servizio varchar(10) *
is_file_moved_on_remote_disk int(11) *
is_file_removed int(11) *
type enum Call recording type SERVICE, ON_DEMAND, AUTOMATIC

Outbound Campaign Calls

Table: ast_pd_history_yyyymm

Key: id, item_number, campagna, lista, insert_time

Field Type Description Note Default
insert_time timestamp Instant insertion of the record unix timestamp
id int(11) unsigned Contact identifier read from the ast_pd_interface table
item_number int(11) unsigned Contact telephone number of the contact read from the ast_pd_interface table
campagna int(11) unsigned Outbound campaign code
lista int(11) unsigned List code associated with the Outbound campaign
phone_number varchar(255) phone number dialed
stato int(11) call status Initial state: 0 = "record to be processed" - Intermediate states: 1 = "call in progress", 4 = "ringing contact", 5 = "call in management to the queuing service", 10 = "call during distribution to operator / agent" - Final call states: 6 = "successfully completed", 7 = "ended unsuccessfully", 8 = "ended with generic error"
call_result varchar(20) Outcome code of the call ANSWER - the contact answered the call; BUSY - the contact is busy; NOANSWER - the contacted number has not been answered;
tentativi int(2) Number of attempts logged for the current contact
dial_sched_time int(11) unsigned *
call_time int(11) unsigned *
data varchar(50) Data needed for the agent's screen popup which are read from the ast_pd_interface table
canale varchar(50) Identifier of the SIP channel from which the call entered
run_id int(11) *
contact_priority int(11) *
contact_uuid varchar(40) *
tentativi_NOANSWER int(2) number of attempts that resulted in "call not answered"
tentativi_CANCEL int(2) number of attempts that resulted in "Call rejected"
tentativi_BUSY int(2) number of attempts that resulted in "Call busy"
tentativi_TVOX_CLOSED int(2) number of attempts that resulted in "Call closed by TVox"
tentativi_AMD int(2) not in use
tentativi_CONGESTION int(2) number of attempts that resulted in a failed call due to congestion

Integration

TVox Data Model can be integrated with any third-party software that can have a Web API (HTTP GET/POST requests) as its data source and can manipulate its response in JSON format.

Microsoft and Google provide some of the most popular tools for data analysis / BI and reporting:

Microsoft Excel & Power BI

Microsoft Excel, both in its desktop and cloud version (Microsoft Office 365), is one of the industry standard for spreadsheet applications featuring calculation and graphing tools for data analysis and reporting.

Microsoft Power BI is a business analytics service. It aims to provide interactive visualizations and business intelligence capabilities with an interface simple enough for end users to create their own reports and dashboards.

Both Excel and Power BI use the Power Query tool to get data from an external source and transform it.

Example:

Below is an example of how to integrate the search for inbound service calls on Excel 2016.

query {
  inboundCalls(search: { year: 2020, month: 5 }) {
    id
    step
    cli
    dnis
  }
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundCalls(search: { year: 2020, month: 5 }) {\n    id\n    step\n    cli\n    dnis\n  }\n}\n"}' --compressed

Power Query

let
    /* Return error messages in table */
    ErrorHandler = (errors) =>   
        let
            #"Conversione in tabella" = Table.FromList(errors, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
            #"Tabella Column1 espansa" = Table.ExpandRecordColumn(#"Conversione in tabella", "Column1", {"message"}, {"message"})
        in  
            #"Tabella Column1 espansa",
    /* Return query result data in table */
    DataHandler = (data) =>
        let
            calls = data[inboundCalls],
            #"Conversione in tabella" = Table.FromList(calls, Splitter.SplitByNothing(), null, null, ExtraValues.Ignore),
            #"Tabella Column1 espansa" = Table.ExpandListColumn(#"Conversione in tabella", "Column1"),
            #"Tabella Column1 espansa1" = Table.ExpandRecordColumn(#"Tabella Column1 espansa", "Column1", {"id", "step", "cli", "dnis"}, {"id", "step", "cli", "dnis"})
        in
            #"Tabella Column1 espansa1",

    Source = Web.Contents(
    "https://<TVOX_HOST>/datamodel/query",
    [
        Headers=[
            #"Method"="POST",
            #"Content-Type"="application/json",
            #"X-Telenia-APIKey"="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
            #"Access-Control-Allow-Origin"="*" 
        ],
        Content=Text.ToBinary("{""query"": ""query { inboundCalls(search: { year: 2020, month: 5 }) { id step cli dnis }}""}")
    ]
    ),
    #"JSON" = Json.Document(Source),
    Result = try ErrorHandler(JSON[errors]) otherwise if JSON[data] <> null then DataHandler(JSON[data]) else null
in
    Result

The Power Query code on the right makes an HTTP POST call to the inboundCalls API passing the APIKey in the header; the result is converted into a table showing for each call step its id, step, cli and dnis.

To execute the request:

  1. Open Excel 2016.
  2. Select the Data tab.
  3. From Get & Transform select New Query > Other sources > Empty query.
  4. From Query open Advanded editor and write/paste the code.

This is just a simple example of how to integrate the TVox Data Model with Excel 2016 but it can be developed according to your needs and also integrated on Microsoft Excel for Office 365 and Microsoft PowerBI.

Google Sheets

Google Sheets is a cloud-based software where you can create and edit spreadsheets directly in your web browser or mobile app (Android or iOS). Multiple people can work simultaneously, you can see people’s changes as they make them, and every change is saved automatically.

Google Sheets does not natively allow you to retrieve data from a web source in JSON format, but it is possible to integrate custom functions (in Javascript code) capable of doing so.

IMPORTJSONAPI (complete documentation here) provides a custom function to selectively extract data from a JSON or GraphQL API in a tabular format suitable for import into a Google Sheets spreadsheet.
Following example uses this function.

Example:

Below is an example of how to integrate the search for inbound service calls on Google Spredsheet.

The Function Query code on the right makes an HTTP POST call to the inboundCalls API passing the APIKey in the header; the result is converted into a table showing for each call step its id, step, cli and dnis.

query {
  inboundCalls(search: { year: 2020, month: 5 }) {
    id
    step
    cli
    dnis
  }
}
curl 'https://<TVOX_HOST>/datamodel/query' -H 'Accept-Encoding: gzip, deflate, br' -H 'Content-Type: application/json' -H 'Accept: application/json' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Origin: https://<TVOX_HOST>' -H 'X-Telenia-APIKey: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' --data-binary '{"query":"query {\n  inboundCalls(search: { year: 2020, month: 5 }) {\n    id\n    step\n    cli\n    dnis\n  }\n}\n"}' --compressed

Function Query

=IMPORTJSONAPI("https://<TVOX_HOST>/datamodel/query"; "$..inboundCalls[*][*]"; "id,step,cli,dnis"; "method=post"; "contentType=application/json"; "headers={ 'X-Telenia-APIKey' : 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' }"; "payload={ 'query': '{ inboundCalls(search: { year: 2020, month: 5 }) { id step cli dnis }}'}")

To add IMPORTJSONAPI custom function to your spreadsheet and use it, follow this procedure:

  1. Open the a Google Sheet spreadsheet in your browser.
  2. Select the Tools > Script editor menu option. This will open a script editor window. You will need to copy and paste the function code into a blank script file.
  3. Copy the entire contents of the IMPORTJSONAPI.gs file. The raw file can be found here.
  4. Paste this into the blank Code.gs script file or another blank script file that you have created.
  5. Select the File > Save menu option to save the script.
  6. You should now be able to use the =IMPORTJSONAPI() function in your sheet.
  7. In your spreadsheet write/paste the code in a cell.

This is just a simple example of how to integrate the TVox Data Model with Google Sheets but it can be developed according to your needs and also integrated on Google Sheets with you own custom function.

Changelog

2.2.2

Available from: 24.8.0, 24.3.25, 24.7.4
* Features / Enhancements
* added new chatsession count query: chatSessionCount

2.2.1

Available from: 24.6 * Features / Enhancements * added new tickets history query: TicketsHistory

2.2.0

Available from: 23.0.0 * Features / Enhancements * added new Power Dialer query: PowerDialerCampaigns, PowerDialerCampaignExecutions, PowerDialerMultiChannelHistory * added new Power Dialer Instant Messaging query: PowerDialerInstantMessagingCampaignStatus, PowerDialerInstantMessagingHistory * added new Chat Channel query: chatHistorySummary, chatHistorySummaryCount, chatSession * added new Callback Call query: callbackCallsHistory, callbackCallsHistoryCount * added new Call Detail Record (CDR) query: callDetailRecords, callDetailRecordsCount, callDetailRecordsSummary

2.1.4

Available from: 22.2.0 * Features / Enhancements * added new Power Dialer query: PowerDialerCampaigns, PowerDialerCampaignExecutions, PowerDialerMultiChannelHistory * added new Power Dialer Instant Messaging query: PowerDialerInstantMessagingCampaignStatus, PowerDialerInstantMessagingHistory

2.1.3

Available from: 23.0.0, 22.1.0, 22.0.12

2.1.2

Available from: 23.0.0, 22.1.0, 22.0.9

2.1.1

Available from: 23.0.0, 22.1.0, 22.0.4

2.1.0

Available from: 23.0.0, 22.1.0, 22.0.2

2.0.0

Available from: 22.0.0

1.2.9

1.2.8

1.2.7

1.2.6

1.2.5

1.2.4

1.2.3

1.2.2

1.2.1

1.2.0

1.1.0

1.0.0