When you list conversations in Conversational Insights, you can filter them by one or more characteristics to narrow down the results. You can also sort the results on select conversation attributes.
Sorting
Conversations returned by the ListConversations
API can be sorted on one of
the following values by passing this in the order_by
field of the request:
create_time {asc, desc}
customer_satisfaction_rating {asc, desc}
duration {asc, desc}
latest_analysis {asc, desc}
start_time {asc, desc}
turn_count {asc, desc}
The default sort order is ascending, but sort order can be set by specifying
asc
or desc
.
Filtering
Conversations can be filtered on one or more of the characteristics listed on the Conversation Filtering page.
Agent ID
Filter conversations that are handled by a specific agent ID. The only supported operator is equality.
REST
Before using any of the request data, make the following replacements:
- PROJECT_ID: your Google Cloud project ID.
- AGENT_ID: the agent ID.
HTTP method and URL:
GET https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/us-central1/conversations?filter=agent_id=\"AGENT_ID\"
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "conversations": [ { "name": "projects/PROJECT_ID/locations/us-central1/conversations/CONVERSATION_ID_1", "agentId": "AGENT_ID", ... }, { "name": "projects/PROJECT_ID/locations/us-central1/conversations/CONVERSATION_ID_2", "agentId": "AGENT_ID", ... }, { "name": "projects/PROJECT_ID/locations/us-central1/conversations/CONVERSATION_ID_3", "agentId": "AGENT_ID", ... }, ] }
Dialogflow conversation
Filter conversations that map to a Dialogflow conversation resource name. The only supported operator is equality. This filter is helpful if you create conversations in Dialogflow, enable Dialogflow runtime integration and want to find out which conversations in Conversational Insights map to which conversations in Dialogflow.
REST
Before using any of the request data, make the following replacements:
- PROJECT_ID: your Google Cloud project ID.
- DIALOGFLOW_CONVERSATION: the Dialogflow conversation resource name. Its format is
projects/{project}/locations/{location}/conversations/{conversation}
HTTP method and URL:
GET https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/us-central1/conversations?filter=data_source.dialogflow_source.dialogflow_conversation=\"DIALOGFLOW_CONVERSATION\"
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "conversations": [ { "name": "projects/PROJECT_ID/locations/us-central1/conversations/CONVERSATION_ID_1", "dataSource": { "dialogflowSource": { "dialogflowConversation": "DIALOGFLOW_CONVERSATION", }, }, ... }, { "name": "projects/PROJECT_ID/locations/us-central1/conversations/CONVERSATION_ID_2", "dataSource": { "dialogflowSource": { "dialogflowConversation": "DIALOGFLOW_CONVERSATION", }, }, ... }, { "name": "projects/PROJECT_ID/locations/us-central1/conversations/CONVERSATION_ID_3", "dataSource": { "dialogflowSource": { "dialogflowConversation": "DIALOGFLOW_CONVERSATION", }, }, ... }, ] }
Dialogflow conversation profile ID
Filter conversations that map to a Dialogflow conversation profile ID. The only supported operator is equality. This filter is helpful if you configure Dialogflow conversation profiles to create conversations in Dialogflow, enable Dialogflow runtime integration and want to find out which conversations in Conversational Insights map to the conversations that were created by a specific Dialogflow conversation profile.
REST
Before using any of the request data, make the following replacements:
- PROJECT_ID: your Google Cloud project ID.
- DIALOGFLOW_CONVERSATION_PROFILE_ID: the Dialogflow conversation profile ID. Note that this is the ID only and not the resource path.
HTTP method and URL:
GET https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/us-central1/conversations?filter=dialogflow_conversation_profile_id=\"DIALOGFLOW_CONVERSATION_PROFILE_ID\"
To send your request, expand one of these options:
You should receive a JSON response similar to the following:
{ "conversations": [ { "name": "projects/PROJECT_ID/locations/us-central1/conversations/CONVERSATION_ID_1", "dialogflowConversationProfileId": "DIALOGFLOW_CONVERSATION_PROFILE_ID", ... }, { "name": "projects/PROJECT_ID/locations/us-central1/conversations/CONVERSATION_ID_2", "dialogflowConversationProfileId": "DIALOGFLOW_CONVERSATION_PROFILE_ID", ... }, { "name": "projects/PROJECT_ID/locations/us-central1/conversations/CONVERSATION_ID_3", "dialogflowConversationProfileId": "DIALOGFLOW_CONVERSATION_PROFILE_ID", ... }, ] }