Thank you every one for your contribution i tested the following Jsonpath and its working as expected.
$.participants[-1].sessions[-1].segments[-1].queueId
Original Message:
Sent: 01-16-2026 14:13
From: Mahmoud Alshobaki
Subject: Looking for Jsonpath to collect the last queueId on the conversation.
Thank you Mateus for your input, i really appreciate it
------------------------------
Mahmoud Alshobaki
Senior Consultant
------------------------------
Original Message:
Sent: 01-15-2026 12:49
From: Mateus Nunes
Subject: Looking for Jsonpath to collect the last queueId on the conversation.
Try to use JSONPath Online Evaluator
Json Path for queueId: $.participants[?(@.purpose=='agent')].sessions[*].segments[?(@.queueId)].queueId (Take the last id)
Json Path for wrap-up id and name: $.participants[?(@.purpose=='agent')].sessions[*].segments[?(@.wrapUpCode)].wrapUpCode
------------------------------
Mateus Nunes
Tech Leader Of CX at Solve4ME
Brazil
Original Message:
Sent: 01-15-2026 12:31
From: Mahmoud Alshobaki
Subject: Looking for Jsonpath to collect the last queueId on the conversation.
Thank you Joaquin for your input
the Jsonpath $..queueId[-1] didnt work as the queue ID is not an array
I am using used the flowing API
get /api/v2/analytics/conversations/{conversationId}/details
I was able to use the following jsonpath $.participants[?(@.purpose == "acd")].participantName
but it gave me all participantNames with the purpose of "acd"
That help little bit, but i am looing to get the last ParticpantName only, any Idea ??
------------------------------
Mahmoud Alshobaki
Senior Consultant
Original Message:
Sent: 01-13-2026 18:38
From: Joaquin Garcia Fink
Subject: Looking for Jsonpath to collect the last queueId on the conversation.
Hi Mahmoud, let me know if this is what you are looking for:
To get the last queueId using JSONPath, you can use the following syntax:
This breaks down as:
$: represents the root of the JSON document
..: recursive descent operator that searches for the key at any level
queueId: the specific key you're looking for
[-1]: array index selector that gets the last element
Alternatively, if your queueIds are in a specific array and you know the exact path, you can use:
$.path.to.array.queueId[-1]
You can test your JSONPath expressions using online tools like https://jsonpath.com/ to verify the results with your specific JSON structure.
This syntax is based on the standard JSONPath operators where $ is the root element, .. is used for recursive descent to search for a key at any level, and [] is the subscript operator used to access array elements.
------------------------------
Joaquin Garcia Fink
Senior Customer Success Manager
Genesys - Employees