Genesys Cloud - Main

 View Only

Sign Up

Data action - Request element of type array

  Thread closed by the administrator, not accepting new replies.
  • 1.  Data action - Request element of type array

    Posted 01-29-2021 16:14
    No replies, thread closed.
    Good day.

    Please if you can support me with the following problem.
    I am creating a custom data action, with the PUT method. And in the input request, they ask me to send an element of type array:

    Body:
    {
      "items": [
      {
      "id": "310117074",
      "quantity": 5,
      "seller": "1",
      "price": 1000,
      "offerings": [],
      "priceTags": [],
      "isGift": false
      },
      {
      "id": "310117075",
      "quantity": 6,
      "seller": "1",
      "price": 500,
      "offerings": [],
      "priceTags": [],
      "isGift": false
    }
    ]
    }

    The question is, if it will be possible to use the escape tool, for the following:
    I write a variable in the following way:
    $b: "{
    "id": "310117074",
    "quantity": 5,
    "seller": "1",
    "price": 1000,
    "offerings": [],
    "priceTags": [],
    "isGift": false
    } |
    {
    "id": "310117075",
    "quantity": 6,
    "seller": "1",
    "price": 500,
    "offerings": [],
    "priceTags": [],
    "isGift": false
    } "

    I apply the "split" function:
    $ b.split ("|")

    And finally convert a string into an array (supposedly), and my request would be as follows: what are they requesting us?

    "requestTemplate": {"items": $b.split ("|")}


    Would it be okay to do this?
    I will appreciate your comments.

    #Integrations

    ------------------------------
    Julio Segil Rodriguez
    Interacciones Inteligentes S.A.
    ------------------------------