Legacy Dev Forum Posts

 View Only

Sign Up

JSON Path Expression Help | Use-case: check if a callback is already in a queue for a phone number

  • 1.  JSON Path Expression Help | Use-case: check if a callback is already in a queue for a phone number

    Posted 06-05-2025 18:43

    faisyou | 2021-10-10 13:25:34 UTC | #1

    I am invoking queue observations api .. .to get the list of queued callbacks and from that I am filtering the record by matching on ani using JSON Path

    following is the response from my API

    { "results": [ { "group": { "queueId": "7d0c40ce-663d-4a0f-b7f5-5648a249f152", "mediaType": "voice" }, "data": [ { "metric": "oWaiting", "stats": { "count": 1 }, "truncated": false, "observations": [ { "observationDate": "2021-10-10T09:14:38.213Z", "conversationId": "5a38f9b7-35e7-4823-91cd-a69d95634fc0", "sessionId": "d2f8cccc-b56d-4550-a35f-90004bebe35a", "requestedRoutingSkillIds": [ "f06b49ae-11d7-4674-a521-dc022d04f7da" ], "requestedLanguageId": "36439cff-b8b5-4fe2-8357-fd5f244d2ff4", "routingPriority": 5, "direction": "inbound", "ani": "tel:xxxx", "dnis": "tel:+966xxxxxx", "requestedRoutings": [ "Standard" ] }, { "observationDate": "2021-10-10T09:19:17.047Z", "conversationId": "2e2daab9-3dd2-4c34-911b-639ee5ce4e8c", "sessionId": "fe5d6541-ec15-4b48-97cf-9e67bfeb6303", "requestedRoutingSkillIds": [ "f06b49ae-11d7-4674-a521-dc022d04f7da" ], "requestedLanguageId": "36439cff-b8b5-4fe2-8357-fd5f244d2ff4", "routingPriority": 5, "direction": "inbound", "ani": "tel:xxxx", "dnis": "tel:+966xxxxxx", "requestedRoutings": [ "Standard" ] } ] } ] } ] } <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

    https://jsonpath.herokuapp.com/

    On the Jay way test web-site the following JSON Path works

    $.results[0].data[0].observations[?(@.ani=="tel:1234")].conversationId

    Buth when I try to use the same expression from a data action - it doesnt return any values

    Can you tell me what might be the issue


    faisyou | 2021-10-10 12:41:31 UTC | #2

    I am attaching the export of the data action FindCallbackInQueue-20211010164054.custom.json|attachment (1.8 KB)


    faisyou | 2021-10-13 06:05:50 UTC | #3

    FYI in case you are interested ... the root cause of this problem is ... in translation map we cannot refer to input parameters ... https://genesyscloud.ideas.aha.io/ideas/CLSELF-I-348

    IMO this is a very useful requirement and come in handy in any situations where filtering by an attribute is not supported by the API .. but then that filtering can be done in the DA ... and also it doesnt really seem too difficult to implement


    Jason_Mathison | 2021-10-13 17:30:16 UTC | #4

    Hi Faisal,

    You are correct that adding the ability to reference an input parameter in a translation map would not be very difficult to implement. We intentionally restricted this in order to prevent any private information passed into the data action from being able to be leaked back out as an output. Please vote on the issue and add any use cases so our Product Manager and dev team can potentially reconsider this choice.

    --Jason


    system | 2021-11-13 17:30:21 UTC | #5

    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: 12314