Method: projects.locations.conversations.calculateStats

Gets conversation statistics.

HTTP request

GET https://{endpoint}/v1/{location=projects/*/locations/*}/conversations:calculateStats

Where {endpoint} is one of the supported service endpoints.

The URLs use gRPC Transcoding syntax.

Path parameters

Parameters
location

string

Required. The location of the conversations.

Query parameters

Parameters
filter

string

A filter to reduce results to a specific subset. This field is useful for getting statistics about conversations with specific properties.

Request body

The request body must be empty.

Response body

The response for calculating conversation statistics.

If successful, the response body contains data with the following structure:

JSON representation
{
  "averageDuration": string,
  "averageTurnCount": integer,
  "conversationCount": integer,
  "smartHighlighterMatches": {
    string: integer,
    ...
  },
  "customHighlighterMatches": {
    string: integer,
    ...
  },
  "issueMatches": {
    string: integer,
    ...
  },
  "issueMatchesStats": {
    string: {
      object (IssueStats)
    },
    ...
  },
  "conversationCountTimeSeries": {
    object (TimeSeries)
  }
}
Fields
averageDuration

string (Duration format)

The average duration of all conversations. The average is calculated using only conversations that have a time duration.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

averageTurnCount

integer

The average number of turns per conversation.

conversationCount

integer

The total number of conversations.

smartHighlighterMatches

map (key: string, value: integer)

A map associating each smart highlighter display name with its respective number of matches in the set of conversations.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

customHighlighterMatches

map (key: string, value: integer)

A map associating each custom highlighter resource name with its respective number of matches in the set of conversations.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

issueMatches
(deprecated)

map (key: string, value: integer)

A map associating each issue resource name with its respective number of matches in the set of conversations. Key has the format: projects/<Project-ID>/locations/<Location-ID>/issueModels/<Issue-Model-ID>/issues/<Issue-ID> Deprecated, use issueMatchesStats field instead.

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

issueMatchesStats

map (key: string, value: object (IssueStats))

A map associating each issue resource name with its respective number of matches in the set of conversations. Key has the format: projects/<Project-ID>/locations/<Location-ID>/issueModels/<Issue-Model-ID>/issues/<Issue-ID>

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

conversationCountTimeSeries

object (TimeSeries)

A time series representing the count of conversations created over time that match that requested filter criteria.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permissions on the location resource:

  • contactcenterinsights.authorizedConversations.list
  • contactcenterinsights.conversations.list

For more information, see the IAM documentation.

TimeSeries

A time series representing conversations over time.

JSON representation
{
  "intervalDuration": string,
  "points": [
    {
      object (Interval)
    }
  ]
}
Fields
intervalDuration

string (Duration format)

The duration of each interval.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

points[]

object (Interval)

An ordered list of intervals from earliest to latest, where each interval represents the number of conversations that transpired during the time window.

Interval

A single interval in a time series.

JSON representation
{
  "startTime": string,
  "conversationCount": integer
}
Fields
startTime

string (Timestamp format)

The start time of this interval.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

conversationCount

integer

The number of conversations created in this interval.