Retrieving a caller's last queue interacted, date/time of the interaction

Hi,

How would I go about retrieving a caller's last interacted queue (from the caller's most recent interaction) as well as the date/time of this interaction. The goal would be to show this in the agent script.

Hi Chris,

The endpoint you want is the conversations details query API

The resolution section of the response has the queue id along with the date/time of when the event occurred. Information on how to query using the API can be found here.

Thanks,
John Carnell
Manager, Developer Engagement

Thanks for the reply. Is there a way I could filter for outbound campaigns only? I dont see a filter for outbound campaigns.

I want to detect the queue from the conversations details query using the ANI to detect which outbound campaign queue the contact last interacted with.

Regards,
Chris

You can add a segment filter on the conversation detail query for outboundCampaignId to refine the results to a specific campaign. You may need to maintain a mapping of phone numbers to campaign IDs to reference in Architect. It's likely possible to string together the necessary API requests to look up an ANI and figure out which campaign its associated with, but it may be easier to just hardcode it into the flow if you don't have too many and they don't change often.

Hi Tim,

Thanks for your response. I've decided to query for the last queueId and then filter by queues from architect. I'm having some trouble with the response template. I'm using /api/v2/analytics/conversations/details/query

I cant seem to get the queueIds as my output

My response template below:
{
"translationMap": {
"queueId": "$.conversations.participants.sessions.segments[?(@.purpose=="acd")].queueId"
},
"translationMapDefaults": {
"queueId": "[]"
},
"successTemplate": "{\n "queueId":${queueId}\n}"
}

Hi Chris,

Can you provide an example of the query results? That makes it much easier to help with the JSON Path. Feel free to redact anything sensitive, just don't alter the "Shape" of the query result.

--Jason

Hi Jason,

The rawresult is as below

{
	"conversations.conversationId": [
		"6aaf514d-5575-4ccd-ab19-5eb0cc3e134f"
	],
	"conversations.participants.sessions.mediaEndpointStats.minMos": [
		[
			[
				[
					4.881195260682755,
					4.883098475798055,
					4.394688762969641,
					4.878633524779465
				]
			],
			[
				[
					4.881113155642161
				]
			],
			[
				[
					4.882947369898625
				]
			],
			[
				[
					4.885991015232634,
					4.877450241849569
				]
			],
			null
		]
	],
	"conversations.participants.sessions.mediaEndpointStats.codecs": [
		[
			[
				[
					[
						"audio/opus"
					],
					[
						"audio/opus"
					],
					[
						"audio/PCMU"
					],
					[
						"audio/opus",
						"audio/opus",
						"audio/opus"
					]
				]
			],
			[
				[
					[
						"audio/opus"
					]
				]
			],
			[
				[
					[
						"audio/opus"
					]
				]
			],
			[
				[
					[
						"audio/opus",
						"audio/opus"
					],
					[
						"audio/opus"
					]
				]
			],
			null
		]
	],
	"conversations.participants.sessions.mediaEndpointStats.discardedPackets": [
		[
			[
				[
					null,
					null,
					null,
					18
				]
			],
			null,
			null,
			[
				[
					38,
					20
				]
			],
			null
		]
	],
	"conversations.participants.sessions.flow.flowName": [
		[
			null,
			[
				"[SL] IVR - Demo"
			],
			[
				"Default In-Queue Flow"
			],
			null,
			null
		]
	],
	"conversations.participants.externalContactId": [
		[
			"75fcf34f-544a-4d3d-baf8-9e3ea36f6b0e",
			null,
			null,
			null,
			null
		]
	],
	"conversations.originatingDirection": [
		"inbound"
	],
	"conversations.participants.sessions.flow.entryReason": [
		[
			null,
			[
				"tel:+60327221892"
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.flow.entryType": [
		[
			null,
			[
				"dnis"
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.segments.conference": [
		[
			[
				[
					false,
					false
				]
			],
			[
				[
					false,
					false
				]
			],
			[
				[
					false,
					false
				]
			],
			[
				[
					false,
					false,
					false
				]
			],
			[
				[
					false
				]
			]
		]
	],
	"conversations.conversationStart": [
		"2022-06-15T01:42:27.152Z"
	],
	"conversations.participants.sessions.segments.sipResponseCodes": [
		[
			null,
			null,
			[
				[
					null,
					[
						410
					]
				]
			],
			null,
			null
		]
	],
	"conversations.participants.sessions.selectedAgentId": [
		[
			[
				"0d39ad55-4854-403c-a8f3-8ae1bad4a0b6"
			],
			null,
			[
				"0d39ad55-4854-403c-a8f3-8ae1bad4a0b6"
			],
			[
				"0d39ad55-4854-403c-a8f3-8ae1bad4a0b6"
			],
			[
				"0d39ad55-4854-403c-a8f3-8ae1bad4a0b6"
			]
		]
	],
	"conversations.participants.sessions.requestedRoutings": [
		[
			[
				[
					"Standard"
				]
			],
			null,
			[
				[
					"Standard"
				]
			],
			[
				[
					"Standard"
				]
			],
			[
				[
					"Standard"
				]
			]
		]
	],
	"conversations.participants.sessions.sessionDnis": [
		[
			[
				"tel:+60327221892"
			],
			[
				"tel:+60327221892"
			],
			[
				"tel:+60327221892"
			],
			[
				"sip:xxxx"
			],
			[
				"sip:xxxx"
			]
		]
	],
	"conversations.participants.sessions.flow.transferTargetAddress": [
		[
			null,
			[
				"f58d7e56-f8ca-44d6-8393-0870ee32c44e"
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.purpose": [
		[
			"customer",
			"ivr",
			"acd",
			"agent",
			"agent"
		]
	],
	"conversations.participants.sessions.dnis": [
		[
			[
				"tel:+60327221892"
			],
			[
				"tel:+60327221892"
			],
			[
				"tel:+60327221892"
			],
			[
				"tel:+60327221892"
			],
			[
				"tel:+60327221892"
			]
		]
	],
	"conversations.mediaStatsMinConversationMos": [
		4.394688762969641
	],
	"conversations.participants.sessions.mediaEndpointStats.receivedPackets": [
		[
			[
				[
					758,
					657,
					2327,
					69681
				]
			],
			[
				[
					759
				]
			],
			[
				[
					658
				]
			],
			[
				[
					69096,
					69653
				]
			],
			null
		]
	],
	"conversations.participants.sessions.peerId": [
		[
			null,
			[
				"a6dcfc55-8464-458c-8ec0-dbdee423f5aa"
			],
			[
				"a6dcfc55-8464-458c-8ec0-dbdee423f5aa"
			],
			[
				"a6dcfc55-8464-458c-8ec0-dbdee423f5aa"
			],
			[
				"a6dcfc55-8464-458c-8ec0-dbdee423f5aa"
			]
		]
	],
	"conversations.participants.sessions.flow.flowVersion": [
		[
			null,
			[
				"49.0"
			],
			[
				"6.0"
			],
			null,
			null
		]
	],
	"conversations.participants.participantId": [
		[
			"d7597840-916a-4478-b49b-da61e380e7dc",
			"61e893df-fd37-4ad8-ae2a-5cde8fe8a2ec",
			"f7b0cd9b-94a1-4fef-a17a-dc6fd9fc95e9",
			"0466dd1c-5035-4d05-9459-bda9fb242533",
			"292dbbf9-4605-47c2-8d53-7ee6f47aa7ab"
		]
	],
	"conversations.participants.sessions.metrics.name": [
		[
			[
				[
					"nConnected"
				]
			],
			[
				[
					"nFlow",
					"nFlowMilestone",
					"nFlowOutcome",
					"oFlowMilestone",
					"tFlowOutcome",
					"tIvr",
					"tFlow",
					"tFlowExit"
				]
			],
			[
				[
					"nOffered",
					"tAcd"
				]
			],
			[
				[
					"tAlert",
					"tAnswered",
					"nConsult",
					"tTalk",
					"tTalkComplete",
					"tAcw",
					"tHandle"
				]
			],
			[
				[
					"tAlert",
					"tNotResponding"
				]
			]
		]
	],
	"conversations.participants.sessions.segments.wrapUpNote": [
		[
			null,
			null,
			null,
			[
				[
					null,
					null,
					"follow with finance needed"
				]
			],
			null
		]
	],
	"conversations.participants.sessions.protocolCallId": [
		[
			[
				"67d5850-0-13c4-6006-21e929f-73332e4b-21e929f"
			],
			[
				"26776af5-fc2a-4ed4-bfba-b2446886fc1f"
			],
			[
				"b58743cc-b8d5-42a0-a76a-780c8443c147"
			],
			[
				"e2391a85-0c5d-4482-a4ee-4801743cff3c"
			],
			[
				"36c4d976-4bdb-41c7-bc08-df6427507112"
			]
		]
	],
	"conversations.participants.sessions.direction": [
		[
			[
				"inbound"
			],
			[
				"inbound"
			],
			[
				"inbound"
			],
			[
				"inbound"
			],
			[
				"inbound"
			]
		]
	],
	"conversations.participants.sessions.flow.exitReason": [
		[
			null,
			[
				"TRANSFER"
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.flow.endingLanguage": [
		[
			null,
			[
				"en-us"
			],
			null,
			null,
			null
		]
	],
	"totalHits": 10,
	"conversations.conversationEnd": [
		"2022-06-15T02:06:31.423Z"
	],
	"conversations.participants.sessions.sessionId": [
		[
			[
				"a6dcfc55-8464-458c-8ec0-dbdee423f5aa"
			],
			[
				"cda1d936-1314-4d25-972f-2f482e9b5817"
			],
			[
				"5e7315c2-d645-40d9-ac5b-1eada936975f"
			],
			[
				"f34b540f-9bba-4fe1-803e-a673883fd9e3"
			],
			[
				"b83f7295-1934-409d-9552-474d16ac4373"
			]
		]
	],
	"conversations.participants.sessions.segments.disconnectType": [
		[
			[
				[
					null,
					"endpoint"
				]
			],
			[
				[
					null,
					"transfer"
				]
			],
			[
				[
					null,
					"transfer"
				]
			],
			[
				[
					null,
					"peer",
					"peer"
				]
			],
			[
				[
					"client"
				]
			]
		]
	],
	"conversations.participants.sessions.agentBullseyeRing": [
		[
			[
				1
			],
			null,
			[
				1
			],
			[
				1
			],
			[
				1
			]
		]
	],
	"conversations.participants.sessions.flow.flowId": [
		[
			null,
			[
				"8a04b42d-47ac-4e80-b4c8-13a4be9a8dca"
			],
			[
				"037f2416-0bfc-4172-afe1-18a8989cae7e"
			],
			null,
			null
		]
	],
	"conversations.participants.sessions.remoteNameDisplayable": [
		[
			[
				"National"
			],
			[
				"Kuala Lumpur, Malaysia"
			],
			[
				"(SL) Inbound Voice"
			],
			null,
			null
		]
	],
	"conversations.participants.sessions.flow.outcomes.flowOutcomeEndTimestamp": [
		[
			null,
			[
				[
					"2022-06-15T01:42:27.408Z"
				]
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.flow.startingLanguage": [
		[
			null,
			[
				"en-us"
			],
			[
				"en-us"
			],
			null,
			null
		]
	],
	"conversations.participants.sessions.flowInType": [
		[
			null,
			null,
			[
				"ivr"
			],
			null,
			null
		]
	],
	"conversations.participants.sessions.routingRing": [
		[
			[
				1
			],
			null,
			[
				1
			],
			[
				1
			],
			[
				1
			]
		]
	],
	"conversations.participants.sessions.usedRouting": [
		[
			[
				"Standard"
			],
			null,
			[
				"Standard"
			],
			[
				"Standard"
			],
			[
				"Standard"
			]
		]
	],
	"conversations.participants.sessions.flow.flowType": [
		[
			null,
			[
				"INBOUNDCALL"
			],
			[
				"INQUEUECALL"
			],
			null,
			null
		]
	],
	"conversations.participants.sessions.flow.outcomes.flowOutcomeId": [
		[
			null,
			[
				[
					"caf15ac1-63c9-40f4-b66c-c2a8e344b5b4"
				]
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.edgeId": [
		[
			[
				"214b4f87-7f70-42a2-99f1-85c9d43d3339"
			],
			[
				"214b4f87-7f70-42a2-99f1-85c9d43d3339"
			],
			[
				"214b4f87-7f70-42a2-99f1-85c9d43d3339"
			],
			[
				"214b4f87-7f70-42a2-99f1-85c9d43d3339"
			],
			[
				"214b4f87-7f70-42a2-99f1-85c9d43d3339"
			]
		]
	],
	"conversations.participants.sessions.metrics.value": [
		[
			[
				[
					1
				]
			],
			[
				[
					1,
					1,
					1,
					1,
					1,
					15079,
					14970,
					14970
				]
			],
			[
				[
					1,
					13154
				]
			],
			[
				[
					12248,
					13154,
					1,
					1397402,
					1397402,
					19000,
					1416027
				]
			],
			[
				[
					15128,
					15128
				]
			]
		]
	],
	"conversations.participants.sessions.recording": [
		[
			[
				true
			],
			null,
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.ani": [
		[
			[
				"tel:0122290991"
			],
			[
				"tel:0122290991"
			],
			[
				"tel:0122290991"
			],
			[
				"tel:0122290991"
			],
			[
				"tel:0122290991"
			]
		]
	],
	"conversations.participants.sessions.segments.segmentStart": [
		[
			[
				[
					"2022-06-15T01:42:27.152Z",
					"2022-06-15T01:42:27.168Z"
				]
			],
			[
				[
					"2022-06-15T01:42:27.156Z",
					"2022-06-15T01:42:27.156Z"
				]
			],
			[
				[
					"2022-06-15T01:42:42.238Z",
					"2022-06-15T01:42:42.242Z"
				]
			],
			[
				[
					"2022-06-15T01:42:43.148Z",
					"2022-06-15T01:42:55.396Z",
					"2022-06-15T02:06:12.423Z"
				]
			],
			[
				[
					"2022-06-15T01:47:34.539Z"
				]
			]
		]
	],
	"conversations.participants.participantName": [
		[
			"National",
			"Kuala Lumpur, Malaysia",
			"(SL) Inbound Voice",
			null,
			null
		]
	],
	"conversations.participants.sessions.segments.wrapUpCode": [
		[
			null,
			null,
			null,
			[
				[
					null,
					null,
					"f704619b-d2c4-4a54-a268-876073bea6a7"
				]
			],
			null
		]
	],
	"conversations.participants.sessions.segments.queueId": [
		[
			[
				[
					null,
					"f58d7e56-f8ca-44d6-8393-0870ee32c44e"
				]
			],
			null,
			[
				[
					"f58d7e56-f8ca-44d6-8393-0870ee32c44e",
					"f58d7e56-f8ca-44d6-8393-0870ee32c44e"
				]
			],
			[
				[
					"f58d7e56-f8ca-44d6-8393-0870ee32c44e",
					"f58d7e56-f8ca-44d6-8393-0870ee32c44e",
					"f58d7e56-f8ca-44d6-8393-0870ee32c44e"
				]
			],
			[
				[
					"f58d7e56-f8ca-44d6-8393-0870ee32c44e"
				]
			]
		]
	],
	"conversations.participants.sessions.mediaEndpointStats.maxLatencyMs": [
		[
			[
				[
					34,
					31,
					30,
					74
				]
			],
			[
				[
					33
				]
			],
			[
				[
					30
				]
			],
			[
				[
					36,
					79
				]
			],
			null
		]
	],
	"conversations.participants.sessions.flow.outcomes.flowOutcomeStartTimestamp": [
		[
			null,
			[
				[
					"2022-06-15T01:42:27.408Z"
				]
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.metrics.emitDate": [
		[
			[
				[
					"2022-06-15T01:42:27.168Z"
				]
			],
			[
				[
					"2022-06-15T01:42:27.271Z",
					"2022-06-15T01:42:27.408Z",
					"2022-06-15T01:42:27.408Z",
					"2022-06-15T01:42:27.408Z",
					"2022-06-15T01:42:27.408Z",
					"2022-06-15T01:42:42.235Z",
					"2022-06-15T01:42:42.241Z",
					"2022-06-15T01:42:42.241Z"
				]
			],
			[
				[
					"2022-06-15T01:42:42.242Z",
					"2022-06-15T01:42:55.396Z"
				]
			],
			[
				[
					"2022-06-15T01:42:55.396Z",
					"2022-06-15T01:42:55.396Z",
					"2022-06-15T01:47:34.539Z",
					"2022-06-15T02:06:12.798Z",
					"2022-06-15T02:06:12.798Z",
					"2022-06-15T02:06:31.423Z",
					"2022-06-15T02:06:31.423Z"
				]
			],
			[
				[
					"2022-06-15T01:47:49.667Z",
					"2022-06-15T01:47:49.667Z"
				]
			]
		]
	],
	"conversations.participants.sessions.mediaEndpointStats.minRFactor": [
		[
			[
				[
					92.39070892333984,
					92.4737319946289,
					92.46887969970703,
					92.27980041503906
				]
			],
			[
				[
					92.38713836669922
				]
			],
			[
				[
					92.46712493896484
				]
			],
			[
				[
					92.60099029541016,
					92.2289047241211
				]
			],
			null
		]
	],
	"conversations.participants.sessions.remote": [
		[
			null,
			[
				"National"
			],
			[
				"National"
			],
			[
				"National"
			],
			[
				"National"
			]
		]
	],
	"conversations.participants.sessions.provider": [
		[
			[
				"Edge"
			],
			[
				"Edge"
			],
			[
				"Edge"
			],
			[
				"Edge"
			],
			[
				"Edge"
			]
		]
	],
	"conversations.participants.sessions.flow.outcomes.flowOutcome": [
		[
			null,
			[
				[
					"caf15ac1-63c9-40f4-b66c-c2a8e344b5b4:SUCCESS"
				]
			],
			null,
			null,
			null
		]
	],
	"conversations.mediaStatsMinConversationRFactor": [
		92.2289047241211
	],
	"conversations.participants.sessions.flow.outcomes.flowOutcomeValue": [
		[
			null,
			[
				[
					"SUCCESS"
				]
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.flow.transferType": [
		[
			null,
			[
				"ACD"
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.flow.transferTargetName": [
		[
			null,
			[
				"(SL) Inbound Voice"
			],
			null,
			null,
			null
		]
	],
	"conversations.participants.sessions.segments.segmentEnd": [
		[
			[
				[
					"2022-06-15T01:42:27.168Z",
					"2022-06-15T02:06:12.798Z"
				]
			],
			[
				[
					"2022-06-15T01:42:27.156Z",
					"2022-06-15T01:42:42.235Z"
				]
			],
			[
				[
					"2022-06-15T01:42:42.242Z",
					"2022-06-15T01:42:55.396Z"
				]
			],
			[
				[
					"2022-06-15T01:42:55.396Z",
					"2022-06-15T02:06:12.798Z",
					"2022-06-15T02:06:31.423Z"
				]
			],
			[
				[
					"2022-06-15T01:47:49.667Z"
				]
			]
		]
	],
	"conversations.participants.sessions.segments.segmentType": [
		[
			[
				[
					"system",
					"interact"
				]
			],
			[
				[
					"system",
					"ivr"
				]
			],
			[
				[
					"delay",
					"interact"
				]
			],
			[
				[
					"alert",
					"interact",
					"wrapup"
				]
			],
			[
				[
					"alert"
				]
			]
		]
	],
	"conversations.participants.userId": [
		[
			null,
			null,
			null,
			"0d39ad55-4854-403c-a8f3-8ae1bad4a0b6",
			"bbbc6ba9-87f5-4fc5-a82c-2e801efaf811"
		]
	],
	"conversations.participants.sessions.mediaEndpointStats.eventTime": [
		[
			[
				[
					"2022-06-15T01:42:42.898Z",
					"2022-06-15T01:42:55.584Z",
					"2022-06-15T02:06:13.064Z",
					"2022-06-15T02:06:13.067Z"
				]
			],
			[
				[
					"2022-06-15T01:42:42.897Z"
				]
			],
			[
				[
					"2022-06-15T01:42:55.584Z"
				]
			],
			[
				[
					"2022-06-15T02:06:13.065Z",
					"2022-06-15T02:06:13.069Z"
				]
			],
			null
		]
	],
	"conversations.divisionIds": [
		[
			"c7592209-2906-4e3d-8025-36c73797c67c"
		]
	],
	"conversations.participants.sessions.mediaType": [
		[
			[
				"voice"
			],
			[
				"voice"
			],
			[
				"voice"
			],
			[
				"voice"
			],
			[
				"voice"
			]
		]
	]
}

What i'd like to get in my response would be the queueId.

My Request is as below

"interval": "${input.StartDate}/${input.EndDate}",
"order": "desc",
"orderBy": "conversationStart",
"paging": {
"pageSize": 1,
"pageNumber": 1
},
"segmentFilters": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "mediaType",
"operator": "matches",
"value": "voice"
},

    {
      "type": "dimension",
      "dimension": "ani",
      "operator": "matches",
      "value": "${input.dnis}"
    }
  ]
}

Hey Chris,

I think that you may have posted the flattened results. Could you grab the response you get in the execute step? That is the original response that the translation map uses.

--Jason

Hi Jason,

Here you go,.

{
"conversations": [
{
"conversationEnd": "2022-06-15T02:06:31.423Z",
"conversationId": "6aaf514d-5575-4ccd-ab19-5eb0cc3e134f",
"conversationStart": "2022-06-15T01:42:27.152Z",
"divisionIds": [
"c7592209-2906-4e3d-8025-36c73797c67c"
],
"mediaStatsMinConversationMos": 4.394688762969641,
"mediaStatsMinConversationRFactor": 92.2289047241211,
"originatingDirection": "inbound",
"participants": [
{
"externalContactId": "75fcf34f-544a-4d3d-baf8-9e3ea36f6b0e",
"participantId": "d7597840-916a-4478-b49b-da61e380e7dc",
"participantName": "National",
"purpose": "customer",
"sessions": [
{
"agentBullseyeRing": 1,
"ani": "tel:0122290991",
"direction": "inbound",
"dnis": "tel:+60327221892",
"edgeId": "214b4f87-7f70-42a2-99f1-85c9d43d3339",
"mediaType": "voice",
"protocolCallId": "67d5850-0-13c4-6006-21e929f-73332e4b-21e929f",
"provider": "Edge",
"recording": true,
"remoteNameDisplayable": "National",
"requestedRoutings": [
"Standard"
],
"routingRing": 1,
"selectedAgentId": "0d39ad55-4854-403c-a8f3-8ae1bad4a0b6",
"sessionDnis": "tel:+60327221892",
"sessionId": "a6dcfc55-8464-458c-8ec0-dbdee423f5aa",
"usedRouting": "Standard",
"mediaEndpointStats": [
{
"codecs": [
"audio/opus"
],
"eventTime": "2022-06-15T01:42:42.898Z",
"maxLatencyMs": 34,
"minMos": 4.881195260682755,
"minRFactor": 92.39070892333984,
"receivedPackets": 758
},
{
"codecs": [
"audio/opus"
],
"eventTime": "2022-06-15T01:42:55.584Z",
"maxLatencyMs": 31,
"minMos": 4.883098475798055,
"minRFactor": 92.4737319946289,
"receivedPackets": 657
},
{
"codecs": [
"audio/PCMU"
],
"eventTime": "2022-06-15T02:06:13.064Z",
"maxLatencyMs": 30,
"minMos": 4.394688762969641,
"minRFactor": 92.46887969970703,
"receivedPackets": 2327
},
{
"codecs": [
"audio/opus",
"audio/opus",
"audio/opus"
],
"discardedPackets": 18,
"eventTime": "2022-06-15T02:06:13.067Z",
"maxLatencyMs": 74,
"minMos": 4.878633524779465,
"minRFactor": 92.27980041503906,
"receivedPackets": 69681
}
],
"metrics": [
{
"emitDate": "2022-06-15T01:42:27.168Z",
"name": "nConnected",
"value": 1
}
],
"segments": [
{
"conference": false,
"segmentEnd": "2022-06-15T01:42:27.168Z",
"segmentStart": "2022-06-15T01:42:27.152Z",
"segmentType": "system"
},
{
"conference": false,
"disconnectType": "endpoint",
"queueId": "f58d7e56-f8ca-44d6-8393-0870ee32c44e",
"segmentEnd": "2022-06-15T02:06:12.798Z",
"segmentStart": "2022-06-15T01:42:27.168Z",
"segmentType": "interact"
}
]
}
]
},
{
"participantId": "61e893df-fd37-4ad8-ae2a-5cde8fe8a2ec",
"participantName": "Kuala Lumpur, Malaysia",
"purpose": "ivr",
"sessions": [
{
"ani": "tel:0122290991",
"direction": "inbound",
"dnis": "tel:+60327221892",
"edgeId": "214b4f87-7f70-42a2-99f1-85c9d43d3339",
"mediaType": "voice",
"peerId": "a6dcfc55-8464-458c-8ec0-dbdee423f5aa",
"protocolCallId": "26776af5-fc2a-4ed4-bfba-b2446886fc1f",
"provider": "Edge",
"remote": "National",
"remoteNameDisplayable": "Kuala Lumpur, Malaysia",
"sessionDnis": "tel:+60327221892",
"sessionId": "cda1d936-1314-4d25-972f-2f482e9b5817",
"mediaEndpointStats": [
{
"codecs": [
"audio/opus"
],
"eventTime": "2022-06-15T01:42:42.897Z",
"maxLatencyMs": 33,
"minMos": 4.881113155642161,
"minRFactor": 92.38713836669922,
"receivedPackets": 759
}
],
"flow": {
"endingLanguage": "en-us",
"entryReason": "tel:+60327221892",
"entryType": "dnis",
"exitReason": "TRANSFER",
"flowId": "8a04b42d-47ac-4e80-b4c8-13a4be9a8dca",
"flowName": "[SL] IVR - Demo",
"flowType": "INBOUNDCALL",
"flowVersion": "49.0",
"startingLanguage": "en-us",
"transferTargetAddress": "f58d7e56-f8ca-44d6-8393-0870ee32c44e",
"transferTargetName": "(SL) Inbound Voice",
"transferType": "ACD",
"outcomes": [
{
"flowOutcome": "caf15ac1-63c9-40f4-b66c-c2a8e344b5b4:SUCCESS",
"flowOutcomeEndTimestamp": "2022-06-15T01:42:27.408Z",
"flowOutcomeId": "caf15ac1-63c9-40f4-b66c-c2a8e344b5b4",
"flowOutcomeStartTimestamp": "2022-06-15T01:42:27.408Z",
"flowOutcomeValue": "SUCCESS"
}
]
},
"metrics": [
{
"emitDate": "2022-06-15T01:42:27.271Z",
"name": "nFlow",
"value": 1
},
{
"emitDate": "2022-06-15T01:42:27.408Z",
"name": "nFlowMilestone",
"value": 1
},
{
"emitDate": "2022-06-15T01:42:27.408Z",
"name": "nFlowOutcome",
"value": 1
},
{
"emitDate": "2022-06-15T01:42:27.408Z",
"name": "oFlowMilestone",
"value": 1
},
{
"emitDate": "2022-06-15T01:42:27.408Z",
"name": "tFlowOutcome",
"value": 1
},
{
"emitDate": "2022-06-15T01:42:42.235Z",
"name": "tIvr",
"value": 15079
},
{
"emitDate": "2022-06-15T01:42:42.241Z",
"name": "tFlow",
"value": 14970
},
{
"emitDate": "2022-06-15T01:42:42.241Z",
"name": "tFlowExit",
"value": 14970
}
],
"segments": [
{
"conference": false,
"segmentEnd": "2022-06-15T01:42:27.156Z",
"segmentStart": "2022-06-15T01:42:27.156Z",
"segmentType": "system"
},
{
"conference": false,
"disconnectType": "transfer",
"segmentEnd": "2022-06-15T01:42:42.235Z",
"segmentStart": "2022-06-15T01:42:27.156Z",
"segmentType": "ivr"
}
]
}
]
},
{
"participantId": "f7b0cd9b-94a1-4fef-a17a-dc6fd9fc95e9",
"participantName": "(SL) Inbound Voice",
"purpose": "acd",
"sessions": [
{
"agentBullseyeRing": 1,
"ani": "tel:0122290991",
"direction": "inbound",
"dnis": "tel:+60327221892",
"edgeId": "214b4f87-7f70-42a2-99f1-85c9d43d3339",
"flowInType": "ivr",
"mediaType": "voice",
"peerId": "a6dcfc55-8464-458c-8ec0-dbdee423f5aa",
"protocolCallId": "b58743cc-b8d5-42a0-a76a-780c8443c147",
"provider": "Edge",
"remote": "National",
"remoteNameDisplayable": "(SL) Inbound Voice",
"requestedRoutings": [
"Standard"
],
"routingRing": 1,
"selectedAgentId": "0d39ad55-4854-403c-a8f3-8ae1bad4a0b6",
"sessionDnis": "tel:+60327221892",
"sessionId": "5e7315c2-d645-40d9-ac5b-1eada936975f",
"usedRouting": "Standard",
"mediaEndpointStats": [
{
"codecs": [
"audio/opus"
],
"eventTime": "2022-06-15T01:42:55.584Z",
"maxLatencyMs": 30,
"minMos": 4.882947369898625,
"minRFactor": 92.46712493896484,
"receivedPackets": 658
}
],
"flow": {
"flowId": "037f2416-0bfc-4172-afe1-18a8989cae7e",
"flowName": "Default In-Queue Flow",
"flowType": "INQUEUECALL",
"flowVersion": "6.0",
"startingLanguage": "en-us"
},
"metrics": [
{
"emitDate": "2022-06-15T01:42:42.242Z",
"name": "nOffered",
"value": 1
},
{
"emitDate": "2022-06-15T01:42:55.396Z",
"name": "tAcd",
"value": 13154
}
],
"segments": [
{
"conference": false,
"queueId": "f58d7e56-f8ca-44d6-8393-0870ee32c44e",
"segmentEnd": "2022-06-15T01:42:42.242Z",
"segmentStart": "2022-06-15T01:42:42.238Z",
"segmentType": "delay"
},
{
"conference": false,
"disconnectType": "transfer",
"queueId": "f58d7e56-f8ca-44d6-8393-0870ee32c44e",
"segmentEnd": "2022-06-15T01:42:55.396Z",
"segmentStart": "2022-06-15T01:42:42.242Z",
"segmentType": "interact",
"sipResponseCodes": [
410
]
}
]
}
]
},
{
"participantId": "0466dd1c-5035-4d05-9459-bda9fb242533",
"purpose": "agent",
"userId": "0d39ad55-4854-403c-a8f3-8ae1bad4a0b6",
"sessions": [
{
"agentBullseyeRing": 1,
"ani": "tel:0122290991",
"direction": "inbound",
"dnis": "tel:+60327221892",
"edgeId": "214b4f87-7f70-42a2-99f1-85c9d43d3339",
"mediaType": "voice",
"peerId": "a6dcfc55-8464-458c-8ec0-dbdee423f5aa",
"protocolCallId": "e2391a85-0c5d-4482-a4ee-4801743cff3c",
"provider": "Edge",
"remote": "National",
"requestedRoutings": [
"Standard"
],
"routingRing": 1,
"selectedAgentId": "0d39ad55-4854-403c-a8f3-8ae1bad4a0b6",
"sessionDnis": "sip:6029e7f63d0d161c9dd97cd4+xxxx.orgspan.com;tgrp=4b586715-a138-483a-b8b4-af408de88d8f;trunk-context=xxxx@localhost",
"sessionId": "f34b540f-9bba-4fe1-803e-a673883fd9e3",
"usedRouting": "Standard",
"mediaEndpointStats": [
{
"codecs": [
"audio/opus",
"audio/opus"
],
"discardedPackets": 38,
"eventTime": "2022-06-15T02:06:13.065Z",
"maxLatencyMs": 36,
"minMos": 4.885991015232634,
"minRFactor": 92.60099029541016,
"receivedPackets": 69096
},
{
"codecs": [
"audio/opus"
],
"discardedPackets": 20,
"eventTime": "2022-06-15T02:06:13.069Z",
"maxLatencyMs": 79,
"minMos": 4.877450241849569,
"minRFactor": 92.2289047241211,
"receivedPackets": 69653
}
],
"metrics": [
{
"emitDate": "2022-06-15T01:42:55.396Z",
"name": "tAlert",
"value": 12248
},
{
"emitDate": "2022-06-15T01:42:55.396Z",
"name": "tAnswered",
"value": 13154
},
{
"emitDate": "2022-06-15T01:47:34.539Z",
"name": "nConsult",
"value": 1
},
{
"emitDate": "2022-06-15T02:06:12.798Z",
"name": "tTalk",
"value": 1397402
},
{
"emitDate": "2022-06-15T02:06:12.798Z",
"name": "tTalkComplete",
"value": 1397402
},
{
"emitDate": "2022-06-15T02:06:31.423Z",
"name": "tAcw",
"value": 19000
},
{
"emitDate": "2022-06-15T02:06:31.423Z",
"name": "tHandle",
"value": 1416027
}
],
"segments": [
{
"conference": false,
"queueId": "f58d7e56-f8ca-44d6-8393-0870ee32c44e",
"segmentEnd": "2022-06-15T01:42:55.396Z",
"segmentStart": "2022-06-15T01:42:43.148Z",
"segmentType": "alert"
},
{
"conference": false,
"disconnectType": "peer",
"queueId": "f58d7e56-f8ca-44d6-8393-0870ee32c44e",
"segmentEnd": "2022-06-15T02:06:12.798Z",
"segmentStart": "2022-06-15T01:42:55.396Z",
"segmentType": "interact"
},
{
"conference": false,
"disconnectType": "peer",
"queueId": "f58d7e56-f8ca-44d6-8393-0870ee32c44e",
"segmentEnd": "2022-06-15T02:06:31.423Z",
"segmentStart": "2022-06-15T02:06:12.423Z",
"segmentType": "wrapup",
"wrapUpCode": "f704619b-d2c4-4a54-a268-876073bea6a7",
"wrapUpNote": "follow with finance needed"
}
]
}
]
},
{
"participantId": "292dbbf9-4605-47c2-8d53-7ee6f47aa7ab",
"purpose": "agent",
"userId": "bbbc6ba9-87f5-4fc5-a82c-2e801efaf811",
"sessions": [
{
"agentBullseyeRing": 1,
"ani": "tel:0122290991",
"direction": "inbound",
"dnis": "tel:+60327221892",
"edgeId": "214b4f87-7f70-42a2-99f1-85c9d43d3339",
"mediaType": "voice",
"peerId": "a6dcfc55-8464-458c-8ec0-dbdee423f5aa",
"protocolCallId": "36c4d976-4bdb-41c7-bc08-df6427507112",
"provider": "Edge",
"remote": "National",
"requestedRoutings": [
"Standard"
],
"routingRing": 1,
"selectedAgentId": "0d39ad55-4854-403c-a8f3-8ae1bad4a0b6",
"sessionDnis": "sip:5d1411da4d64911864921da0+xxxx.orgspan.com;tgrp=4b586715-a138-483a-b8b4-af408de88d8f;trunk-context=xxxx@localhost",
"sessionId": "b83f7295-1934-409d-9552-474d16ac4373",
"usedRouting": "Standard",
"metrics": [
{
"emitDate": "2022-06-15T01:47:49.667Z",
"name": "tAlert",
"value": 15128
},
{
"emitDate": "2022-06-15T01:47:49.667Z",
"name": "tNotResponding",
"value": 15128
}
],
"segments": [
{
"conference": false,
"disconnectType": "client",
"queueId": "f58d7e56-f8ca-44d6-8393-0870ee32c44e",
"segmentEnd": "2022-06-15T01:47:49.667Z",
"segmentStart": "2022-06-15T01:47:34.539Z",
"segmentType": "alert"
}
]
}
]
}
]
}
],
"totalHits": 10
}

To work this issue I plugged your response object into

http://jsonpath.herokuapp.com/

And worked my way through the response. Starting with $.conversations[*] and adding one additional layer at a time. The big hang up you were probably having is that any time you are dealing with an array you need to specify which entry/entries to filter on. * for all entries, ?(@. style for a filter, or rarely a specific entry like 0 or 1.

The JSONPath that I eventually came up with was:

$.conversations[*].participants[?(@.purpose=="acd")].sessions[*].segments[*].queueId

You would probably still need to use FirstFromArray in the data action to grab the first queueid.

--Jason

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.