HTTP POSt request format for nested object

uiautomation
activities
studio
api

#1

Hi all,

I am using HTTP API Post method request.

If the format of Body data in following form the API work perfectly.

{
      "channelId":"RPA",
      "cifId":"123456789",
      "serReqId":"getlist",
      "requestUUID":"12345678",
}

But I need to pass body data in following form:

{
   "webServiceReq":{
      "channelId":"RPA",
      "cifId":"123456789",
                      "serReqId":"getlist",
                      "requestUUID":"12345678",
                      "request":
                                        {
                                                            "custId":"0122345678"
                                        }                  
      }
}

Can anyone please help me to sort out this.

How to pass the above values in the parameters?


#2

@Rahul_S Instead of passing values in parameter, you can pass the entire JSON as string in Body property of “HTTP request” activity.( Please see attached screenshot)
Note: Make sure the json is converted in single line string. If needed escape double quotes with one more double quote.
In your case pass body as string:
{"“webServiceReq”":{"“channelId”":"“RPA”","“cifId”":"“123456789"”,"“serReqId”":"“getlist”","“requestUUID”":"“12345678"”,"“request”":{"“custId”":"“0122345678"”}}}

Let me know if it works for you.


#3

Thanks a lot for Reply.

But now getting following error:

{"data":{"status":{"isSuccess":false,"message":"Unable to process your request:ERR0001","statusCode":"ERR0001"}}}

Any help would be appreciated.

Thanks