N03xCu53 | 2024-05-21 02:01:52 UTC | #1
I'm currently using below Data Action to return totalHits by callbackNumber, interval and queueId. This is based off another topic "https://developer.genesys.cloud/forum/t/is-callback-exists-from-the-same-number-in-the-same-queue/10583" but with pageSize set to 25.
Data Action Config Contact
Configuration:
Request Body Template
{
"interval": "${input.Interval}",
"order": "desc",
"orderBy": "segmentStart",
"paging": {
"pageSize": 25,
"pageNumber": 1
},
"segmentFilters": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "callbackNumber",
"operator": "matches",
"value": "${input.CallbackNumber}"
},
{
"type": "dimension",
"dimension": "purpose",
"operator": "matches",
"value": "acd"
},
{
"type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "${input.QueueId}"
},
{
"type": "dimension",
"dimension": "segmentEnd",
"operator": "notExists"
},
{
"type": "dimension",
"dimension": "mediaType",
"operator": "matches",
"value": "callback"
}
]
}
],
"conversationFilters": [
{
"type": "and",
"predicates": [
{
"type": "dimension",
"dimension": "conversationEnd",
"operator": "notExists"
}
]
}
]
}
Response
{
"translationMap": {
"TotalCallsByANI": "$.totalHits",
"ConversationID_1": "$.conversations[0].conversationId",
"ConversationID_2": "$.conversations[1].conversationId",
"ConversationID_3": "$.conversations[2].conversationId",
"ConversationID_4": "$.conversations[3].conversationId",
"ConversationID_5": "$.conversations[4].conversationId",
"ConversationID_6": "$.conversations[5].conversationId",
"ConversationID_7": "$.conversations[6].conversationId",
"ConversationID_8": "$.conversations[7].conversationId",
"ConversationID_9": "$.conversations[8].conversationId",
"ConversationID_10": "$.conversations[9].conversationId"
},
"translationMapDefaults": {
"TotalCallsByANI": "null",
"ConversationID_1": "\"NA\"",
"ConversationID_2": "\"NA\"",
"ConversationID_3": "\"NA\"",
"ConversationID_4": "\"NA\"",
"ConversationID_5": "\"NA\"",
"ConversationID_6": "\"NA\"",
"ConversationID_7": "\"NA\"",
"ConversationID_8": "\"NA\"",
"ConversationID_9": "\"NA\"",
"ConversationID_10": "\"NA\""
},
"successTemplate": "{\n \"TotalCallsByANI\": ${TotalCallsByANI}\n,\n \"ConversationID_1\": ${ConversationID_1}\n,\n \"ConversationID_2\": ${ConversationID_2}\n,\n \"ConversationID_3\": ${ConversationID_3}\n,\n \"ConversationID_4\": ${ConversationID_4}\n,\n \"ConversationID_5\": ${ConversationID_5}\n,\n \"ConversationID_6\": ${ConversationID_6}\n,\n \"ConversationID_7\": ${ConversationID_7}\n,\n \"ConversationID_8\": ${ConversationID_8}\n,\n \"ConversationID_9\": ${ConversationID_9}\n,\n \"ConversationID_10\": ${ConversationID_10}\n}"
}
Output
Question:
- Is there a way to return the list of callback conversationIDs as an array rather than individual fields.
- How can we disconnect the list of callback conversationIDs with a single Data Action
Jason_Mathison | 2024-05-22 13:44:09 UTC | #2
- You can get an array of values with your JSON path expresions. If you go to this JSON Path testing site: https://www.javainuse.com/jsonpath
You can gather a list of the batters -> batter -> id values with this jsonpath: $.batters.batter[*].id
Hopefully that gives you an idea for how you can approach your problem.
- I am not aware of any such API, but you could ask about it in the platform room. Other options include looping through the list in a flow, or writing an external application to take care of this in AWS Lambda, Google Function, Genesys Functions (in beta), or an external web service.
--Jason
system | 2024-06-22 13:44:11 UTC | #3
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 26370