REST CALL Problem

Hi ,

I am setting a rest call using Integration Smart Service and on the field which is text I need to sent a sprecific structure like follow:

{ { "Name": "Name1","Value": pv!Value1},{ "Name": "Name2","Value": pv!Value2}} .

I try several different scenarios but nothing is complete as expected.

Please advice me how to proceed.

Thanks in advance.

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to natasav

    OK. So this is all about "Parameters"? Which data type is "ri!Parametarts" (Is this a typo?)? String? If yes, why?

    What I see is that it seems that the API expects a list of Name/Value pairs. The easiest way to create this is like you initially did

    {
      {
        "Name": "requested",
        "Value" : ri!SystemInfo.Firewall_requestedFor
      },
      {
        "Name": "Source",
        "Value": ri!SystemInfo.Firewall_sourceAD_IP
      },
      {
        "Name": "Destination",
        "Value": ri!SystemInfo.Firewall_destinationIPs
      }
    }

    But make the rule input "Parametarts" (Typo?) an "any" type. This way you pass a data structure into the integration. Here it  is added to the internal data structure and then it is turned into JSON altogether.

    BTW an integration turns a dictionary or CDT into JSON on its own. The toJson() is not needed.

Children