Author Message
EdwardBrandow
Joined: Jan 28, 2014
Messages: 41
Offline
How can you specify an array in the payload field when using the rest web services in engagement designer.

The docs show a simple example
Payload (mandatory if using the REST Service call) – The data being sent to the website.
The parameter in payloads is in the curly bracket {}. Its name should contain only
alphanumeric characters. For example, {"email":"{payloadParam1}",
"user":"{payloadParam2}"}

but I need this as my input payload
{"to":"{toAddress}","from":"{fromAddress}","workRequestId":"{workRequestId}","messageService":"{messageService}","message":[{"type":"{type}","content":"{messageText}"}]}

and when I specify that as the payload it flattens the object to this schema which is not what I wanted (see attached image)
  • [Thumb - EDSchema.jpg]
[Disk] Download
AnuragAggarwal
Joined: Jun 1, 2014
Messages: 154
Offline
Hi Edward,

if you map values to this schema and execute the REST task, you would get something like

{toAddress: .. , fromAddress: .. , }

is this not your target payload ?
EdwardBrandow
Joined: Jan 28, 2014
Messages: 41
Offline
yes this is not an issue. Using the payload I specified, the parameters are filled in correctly and I am sending the correct body, including the array.

Body: {"useTag":"XXX","to":"8178944272","from":"87111111","workRequestId":null,"messageService":"SMS","message":[{"type":"TEXT","content":"Message"}]}

it did not work originally so I thought ED was generating the incorrect body but it was a problem with the actual rest service. Once I corrected that it received and processed my messages from ED correctly.

Thanks, sorry for the wild goose chase. Its all good.
Go to:   
Mobile view