Genesys Cloud - Main

 View Only

Discussion Thread View
  • 1.  Data Action - Get value from JSON output

    Posted 09-23-2021 09:49
      |   view attached
    Hi all,
    hope someone can assist, i am getting Queue Service Level value via API = /api/v2/routing/queues?id=${input.id} via a Data Action

    data is returned in JSON format and require only the Queue Service Level value to assign to an output.

    i have attached a detailed document with all relevant info and hoping someone is able to guide me in the right direction.
    #Routing(ACD/IVR)

    ------------------------------
    Reginald Sheraton
    ------------------------------

    Attachment(s)

    pdf
    APi Called.pdf   99 KB 1 version


  • 2.  RE: Data Action - Get value from JSON output
    Best Answer

    Posted 09-23-2021 16:32
    Hi Reginald

    Try this as your output contract.  This should get you started:

    {
    "type": "object",
    "properties": {
    "entities": {
    "type": "array",
    "items": {
    "title": "items",
    "type": "object",
    "properties": {
    "mediaSettings": {
    "type": "object",
    "properties": {
    "call": {
    "type": "object",
    "properties": {
    "serviceLevel": {
    "type": "object",
    "properties": {
    "durationMs": {
    "type": "integer"
    }
    },
    "additionalProperties": true
    }
    },
    "additionalProperties": true
    }
    },
    "additionalProperties": true
    }
    },
    "additionalProperties": true
    }
    }
    },
    "additionalProperties": true
    }

    ------------------------------
    Vaun McCarthy
    NTT New Zealand Limited
    ------------------------------



  • 3.  RE: Data Action - Get value from JSON output

    Posted 09-24-2021 04:48
    Hi all,
    thanks for your prompt response.
    Thanks Vaun, that did the trick

    ------------------------------
    Reginald Sheraton
    ------------------------------



  • 4.  RE: Data Action - Get value from JSON output

    Top 25 Contributor
    Posted 09-23-2021 23:48
    Edited by Anton Vroon 09-23-2021 23:49
    I use the following three sites to help me figure out what I need when building DataActions like that.

    https://jsonpathfinder.com/
    https://jsonpath.com/
    https://goessner.net/articles/JsonPath/index.html#e2

    So from those I get an output path of
    $.[entities.mediaSettings.callback.serviceLevel.durationMs][0]
    For that service level value

    Oh and I would suggest posting questions like this one in the Genesys Cloud Developer Forum instead :)



    ------------------------------
    Anton Vroon
    KiwiBank
    ------------------------------



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources