Sending an array through HTTP Request

Hello,
I have to send an array as parameter (the API only supports the said parameter as array) but I don’t know how to do it. I managed make it work in Postman but it doesn’t in UiPath.
There are two arrays actually, one for sender and one for receiver. Each array has to contain the following: name: string, contact: string, phone1: string, locality_id: integer, street: string.
Postman:



API requires auth.
Any thoughts?

Hey @s0biesky

Do you need an array or some key-value data type like dictionary? or maybe jobject?
Regular arrays do not have keys so you cannot assign data like sender.name = “Someone”

In documentation it says array. But I’m willing to try whatever as long as I can send it as parameter

If so, you might need a json or xml array. You might want to use jObject and convert it to string. Please check those pages:

Creating JSON ← Creating JSON with LINQ

1 Like

Had to use a different tactic but the idea was overall the same, thank you.

@s0biesky

Great to hear that!
Could you share the solution? It might be helpful for other people in the future.

Yeah sure, sorry for the late reply.
I made a big json array using invoke methods and i passed it to the http request as body.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.