Log sessions preview
Query
Access information about all the log sessions by executing:
query SessionsPreviewV2(
$accountId: uuid
$deskIds: _uuid
$brainIds: _uuid
$integrationIds: _uuid
$brainVersions: _int4
$channels: _text
$startDate: timestamp
$endDate: timestamp
$minNumUserMessages: Int
$maxConfidence: float8
$minHumanResponseTime: float8
$ratings: _int4
$tags: _text
$rule_ids: _uuid
$sessionId: String
$userId: String
$userName: String
$userEmail: String
$channelUserId: String
$externalUserId: String
$isContained: Boolean
$isCovered: Boolean
$isTest: Boolean
$hasCollection: Boolean
$hasCollectionSources: Boolean
$agentIds: _text
$isMeaningful: Boolean
$limit: Int
) {
rows: logs_sessions_preview_v2(
limit: $limit
args: {
start_time: $startDate
end_time: $endDate
account_id: $accountId
brain_parent_ids: $brainIds
desk_ids: $deskIds
integration_ids: $integrationIds
brain_versions: $brainVersions
channels: $channels
min_num_user_messages: $minNumUserMessages
max_confidence: $maxConfidence
min_human_response_time: $minHumanResponseTime
ratings: $ratings
tags: $tags
rule_ids: $rule_ids
session_id: $sessionId
user_id: $userId
user_name: $userName
user_email: $userEmail
channel_user_id: $channelUserId
external_user_id: $externalUserId
is_contained: $isContained
is_covered: $isCovered
is_test: $isTest
has_collection: $hasCollection
has_collection_sources: $hasCollectionSources
agent_ids: $agentIds
is_meaningful: $isMeaningful
}
) {
avg_confidence
brain_id
brain_parent_id
brain_version
channel
channel_user_id
user_id
user_name
user_email
desk_id
start_time
end_time
expired_time
external_user_id
integration_id
is_contained
is_covered
is_test
min_confidence
participated_brains
participated_collections
participated_agents
rating
feedback
session_id
tags
rule_ids
total_user_messages
avg_human_response_time
avg_response_time
human_first_response_time
}
}
Input Arguments
The following Sessions Preview arguments can specify and fine tune the search for sessions
Argument | Type | Description |
---|---|---|
deskIds | _uuid | A set of desk Ids to filter sessions coming from the input desk(s) |
brainIds | _uuid | A set of brain Ids to filter sessions coming from the input brain(s) |
integrationIds | _uuid | A set of integration Ids to filter sessions coming from the input integration(s) |
brainVersions | _int4 | A set of brain versions to filter sessions coming from the input version(s) |
channels | _text | A set of channels to filter sessions coming from the input channel(s) |
startDate | timestamp | The start date in format yyyy-mm-dd |
endDate | timestamp | The end date in format yyyy-mm-dd |
minNumUserMessages | Int | An integer to filter sessions with more messages than minNumUserMessages |
maxConfidence | float8 | A float to filter sessions with minimum confidence less than maxConfidence |
ratings | _int4 | A set of integers to filter sessions with the input ratings |
tags | _text | A set of strings to filter sessions with the specified tags |
sessionId | String | Only the session with the specified session Id will be returned |
userId | String | Only the session(s) with the specified user Id will be returned |
channelUserId | String | Only the session(s) with the specified channel user Id will be returned |
externalUserId | String | Only the session(s) with the specified external user Id will be returned |
isContained | Boolean | Filter the contained or non-contained sessions |
isCovered | Boolean | Filter the covered or non-covered sessions |
isTest | Boolean | Filter out test sessions (i.e sessions coming from the webchat preview) |
agentIds | _text | A set of agent Ids to filter sessions in which any of the input agents participated |
limit | Int | An integer to specify the maximum number of returned sessions |
Return Fields
The Sessions Preview query returns a list of Sessions, where each Session has the following fields:
Field | Type | Description |
---|---|---|
desk_id | uuid | The desk Id in which the session belongs |
brain_parent_id | uuid | The brain Id in which the session belongs |
integration_id | uuid | The integration Id in which the session belongs |
brain_version | int4 | The version of the brain in which the session belongs |
channel | String | The channel from which the session started |
start_time | timestamp | The time the session started |
end_time | timestamp | The time the session ended |
total_user_messages | Int | The number of user messages in the session |
min_confidence | float8 | The minimum confidence across all brain predictions in the session |
avg_confidence | float8 | The average confidence across all brain predictions in the session |
rating | Int | The rating the session received. Null if the session was not rated |
tags | _text | The tags of the session. Null if no tags exist |
sessionId | String | The Id of the session |
user_id | String | User Id of the user participating in the session |
channel_user_id | String | Channel User Id of the user participating in the session. Null if the channel is web |
external_user_id | String | External Id of the user participating in the session. Null if not set |
user_name | String | The name of the user participating in the session |
is_contained | Boolean | True if the session is contained, false otherwise |
is_covered | Boolean | True if the session is covered, false otherwise |
is_test | Boolean | True if the session is test, false otherwise |
participated_agents | _text | A list of agent Ids and agent names participated in the session |
Examples
Below are some examples of how SessionsPreviewV2
can be called.
- Single Desk
- Multiple Desks
- Multiple Brains
- Brain Versions
- Specific Channels
- Specific Tags
- Specific Ratings
- Max Confidence
- Contained&Covered
- Min Num. User Messages
- External/Channel User ID
{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}
{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c, 51ff88a7-dfab-44e5-9303-9b2bf13f1c94}",
"startDate": "2022-04-08",
"endDate": "2022-04-17",
"limit": 10
}
{
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c, 99xx33p9-dfab-44e5-9303-9b2bf13f1c94}",
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}
{
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"brainVersions": "{37,38,39}",
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}
{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"channels": "{web, facebook, viber}",
"brainVersions": "{37,38,39}",
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}
{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"channels": "{web}",
"tags": "{success_reschedule, change_address}",
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}
{
"deskIds": "{d2be0283-9b53-4d7b-b77d-2650f3a1a99c}",
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"ratings": "{1,2,3}",
"tags": "{success_reschedule, change_address}",
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}
{
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"maxConfidence": 0.7,
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}
{
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"isCovered": false,
"isContained": true,
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}
{
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"isCovered": false,
"minNumUserMessages": 2
"startDate": "2022-04-08",
"endDate": "2022-04-17"
}
{
"brainIds": "{a2wv9283-9b53-4d7b-b77d-2650f3a1a99c}",
"userId": "mApUE81oSmzUWTA_w2ZbL",
"channelUserId": "ePlhV5VeCXg"
}
Example Result
{
"data": {
"rows": [
{
"avg_confidence": 0.9334274,
"brain_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"brain_parent_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"brain_version": 8,
"channel": "web",
"channel_user_id": null,
"user_id": "pMyA-YY75nmw45XbqWg88",
"user_name": "Visitor 438",
"desk_id": "d2be0283-9b53-4d7b-b77d-2650f3a1a99c",
"start_time": "2022-04-07T11:40:28.772",
"end_time": "2022-04-07T11:48:41.092",
"external_user_id": null,
"integration_id": "1388a63d-2275-4446-9f20-povv9203w000",
"is_contained": false,
"is_covered": true,
"is_test": true,
"min_confidence": 0.8668548,
"participated_agents": [
{
"agent_id": "4v57b8ba-c1de-42ac-94ad-564e0c6858c9",
"agent_name": "George Johnson"
}
],
"rating": 5,
"session_id": "1234a3ba-33fd-4add-be5e-f73030242bee",
"tags": null,
"total_user_messages": 2
},
{
"avg_confidence": 0.8721187,
"brain_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"brain_parent_id": "a2wv9283-9b53-4d7b-b77d-2650f3a1a99c",
"brain_version": 8,
"channel": "web",
"channel_user_id": null,
"user_id": "BEzx-zR1Jh4wlY9PnyTe9",
"user_name": "Visitor 435",
"desk_id": "d2be0283-9b53-4d7b-b77d-2650f3a1a99c",
"start_time": "2022-04-06T15:09:43.491",
"end_time": "2022-04-06T15:12:07.31",
"external_user_id": null,
"integration_id": "1388a63d-2275-4446-9f20-povv9203w000",
"is_contained": true,
"is_covered": true,
"is_test": false,
"min_confidence": 0.74423736,
"participated_agents": null,
"rating": 2,
"session_id": "58be4fe7-96af-409b-8ae2-cf6b1c4b44cc",
"tags": [
"moveo_start"
],
"total_user_messages": 4
}
]