- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- TimeGranularity
- Dimension
- IssueDimensionMetadata
- AgentDimensionMetadata
- QaQuestionDimensionMetadata
- QaQuestionAnswerDimensionMetadata
- DimensionKey
- Try it!
Query metrics.
HTTP request
POST https://{endpoint}/v1/{location=projects/*/locations/*}:queryMetrics
Where {endpoint}
is one of the supported service endpoints.
The URLs use gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
location |
Required. The location of the data. "projects/{project}/locations/{location}" |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "filter": string, "timeGranularity": enum ( |
Fields | |
---|---|
filter |
Required. Filter to select a subset of conversations to compute the metrics. Must specify a window of the conversation create time to compute the metrics. The returned metrics will be from the range [DATE(starting create time), DATE(ending create time)). |
time |
The time granularity of each data point in the time series. Defaults to NONE if this field is unspecified. |
dimensions[] |
The dimensions that determine the grouping key for the query. Defaults to no dimension if this field is unspecified. If a dimension is specified, its key must also be specified. Each dimension's key must be unique. If a time granularity is also specified, metric values in the dimension will be bucketed by this granularity. Up to one dimension is supported for now. |
measure |
Measures to return. Defaults to all measures if this field is unspecified. A valid mask should traverse from the This is a comma-separated list of fully qualified names of fields. Example: |
Response body
If successful, the response body contains an instance of Operation
.
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.
TimeGranularity
A time granularity divides the time line into discrete time periods. This is useful for defining buckets over which filtering and aggregation should be performed.
Enums | |
---|---|
TIME_GRANULARITY_UNSPECIFIED |
The time granularity is unspecified and will default to NONE. |
NONE |
No time granularity. The response won't contain a time series. This is the default value if no time granularity is specified. |
DAILY |
Data points in the time series will aggregate at a daily granularity. 1 day means [midnight to midnight). |
HOURLY |
Data points in the time series will aggregate at a daily granularity. 1 HOUR means [01:00 to 02:00). |
PER_MINUTE |
Data points in the time series will aggregate at a daily granularity. PER_MINUTE means [01:00 to 01:01). |
PER_5_MINUTES |
Data points in the time series will aggregate at a 1 minute granularity. PER_5_MINUTES means [01:00 to 01:05). |
MONTHLY |
Data points in the time series will aggregate at a monthly granularity. 1 MONTH means [01st of the month to 1st of the next month). |
Dimension
A dimension determines the grouping key for the query. In SQL terms, these would be part of both the "SELECT" and "GROUP BY" clauses.
JSON representation |
---|
{ "dimensionKey": enum ( |
Fields | |
---|---|
dimension |
The key of the dimension. |
Union field dimension_metadata . Output-only metadata about the dimension. dimension_metadata can be only one of the following: |
|
issue |
Output only. Metadata about the issue dimension. |
agent |
Output only. Metadata about the agent dimension. |
qa |
Output only. Metadata about the QA question dimension. |
qa |
Output only. Metadata about the QA question-answer dimension. |
IssueDimensionMetadata
Metadata about the issue dimension.
JSON representation |
---|
{ "issueId": string, "issueDisplayName": string, "issueModelId": string } |
Fields | |
---|---|
issue |
The issue ID. |
issue |
The issue display name. |
issue |
The parent issue model ID. |
AgentDimensionMetadata
Metadata about the agent dimension.
JSON representation |
---|
{ "agentId": string, "agentDisplayName": string, "agentTeam": string } |
Fields | |
---|---|
agent |
Optional. A user-specified string representing the agent. |
agent |
Optional. The agent's name |
agent |
Optional. A user-specified string representing the agent's team. |
QaQuestionDimensionMetadata
Metadata about the QA question dimension.
JSON representation |
---|
{ "qaScorecardId": string, "qaQuestionId": string, "questionBody": string } |
Fields | |
---|---|
qa |
Optional. The QA scorecard ID. |
qa |
Optional. The QA question ID. |
question |
Optional. The full body of the question. |
QaQuestionAnswerDimensionMetadata
Metadata about the QA question-answer dimension. This is useful for showing the answer distribution for questions for a given scorecard.
JSON representation |
---|
{ "qaScorecardId": string, "qaQuestionId": string, "questionBody": string, "answerValue": string } |
Fields | |
---|---|
qa |
Optional. The QA scorecard ID. |
qa |
Optional. The QA question ID. |
question |
Optional. The full body of the question. |
answer |
Optional. The full body of the question. |
DimensionKey
The key of the dimension.
Enums | |
---|---|
DIMENSION_KEY_UNSPECIFIED |
The key of the dimension is unspecified. |
ISSUE |
The dimension is keyed by issues. |
AGENT |
The dimension is keyed by agents. |
AGENT_TEAM |
The dimension is keyed by agent teams. |
QA_QUESTION_ID |
The dimension is keyed by QaQuestionIds. Note that: We only group by the QuestionId and not the revision-id of the scorecard this question is a part of. This allows for showing stats for the same question across different scorecard revisions. |
QA_QUESTION_ANSWER_VALUE |
The dimension is keyed by QaQuestionIds-Answer value pairs. Note that: We only group by the QuestionId and not the revision-id of the scorecard this question is a part of. This allows for showing distribution of answers per question across different scorecard revisions. |
CONVERSATION_PROFILE_ID |
The dimension is keyed by the conversation profile ID. |