# Http request Wizard parameters with the same name

**URL:** <https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397>\
**Category:** Studio\
**Tags:** activities-panel, datatable, question, studio, robot, webapi, activities\
**Created:** [July 14, 2023, 11:15am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397 "2023-07-14T11:15:40Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 14, 2023, 11:15am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/1 "2023-07-14T11:15:40Z")

</div>

Hello guys. So im trying to make an API call. Im using excel to take the data that I need and loop it, but I have a problem. There is a header that is neccessary to the succesion of the call called photos. When trying online, it only worked like this:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/6/7/d/67dc60ba53d0e113e67d2bd987fc58f754b1216e.png)  
My http request parameters look like this:  
 ![image](https://global.discourse-cdn.com/uipath/original/4X/1/9/0/19058ca2393c5e034a1f3b0cf3a5a3b3c6a82048.png)  
I can’t put in another photos parameter in, because it already exists. How can I do this?

The error is: `An item with the same key has already been added. Key: photos[""]`

---

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 14, 2023, 12:24pm UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/2 "2023-07-14T12:24:06Z")

</div>

Any help, suggestions would be much appreciated. Desperate to get it working. Im so close, but yet, so far 😃

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [July 14, 2023, 1:24pm UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/3 "2023-07-14T13:24:14Z")

</div>

@Povilas_Jonikas

These suggestions might help you…Its a similar kind of request

> [@HTTP Request (UipPath.Web.Activities.HttpClient) with more than one attachment for Freshdesk API](https://forum.uipath.com/t/http-request-uippath-web-activities-httpclient-with-more-than-one-attachment-for-freshdesk-api/496167/17):
>
> Short update on that. I unfortunately got no reply from FD support yet to confirm how it works. But I tried around a bit with the API and the only way it works, is to name all attachments the same. So I decided to go for Invoke Code and came up with this working thingy: Dim client As System.Net.Http.HttpClient = New System.Net.Http.HttpClient() client.BaseAddress = New Uri(EndPoint) client.DefaultRequestHeaders.Accept.Clear() client.DefaultRequestHeaders.Accept.Add(New System.Net.Htt…

cheers

---

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 17, 2023, 8:31am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/4 "2023-07-17T08:31:02Z")

</div>

Thanks Anil for the response,

But im lost. I tried to folow the method you sent me, but i was unsucsesful. I just have little to no knowlage of the VBA codes reading. Could you please be so kind and help me? The main headers are accept and Content-Type. The main parameters are username, password, user\_token and photos 4 times. The photos value is comming from an excel file. Could you please help me. Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 17, 2023, 8:32am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/5 "2023-07-17T08:32:43Z")

</div>

After the unsuccseful attempt with the suggestion i Though, is it possible to do the api call using the “Body” in my case? Lets say I could write a body, with the parameters values like CurrentRow.Item(“photos1”).ToString.  
Would this overcome the photos key duplicate error?

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [July 17, 2023, 8:34am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/6 "2023-07-17T08:34:47Z")

</div>

@Povilas_Jonikas

did you try to add each file as attachment and then try toe xecute?

alternated trying body with key also would be a good idea never tried so cannot comment if it would work…you can try and let us know

as far as vb code…can you tell what you tried and where you are facing an issue

cheers

---

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 17, 2023, 8:57am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/8 "2023-07-17T08:57:56Z")

</div>

Firstly, ill try to do the body thing, because i think it would be the easiest solution. I wrote down the whole body, but I still keep getting errors, because the configuration is wrong i think. Maybe you could help me with this? This is how the body looks like now:

```auto
"username"="signeda"&"password"=<<"aaaaaaaaaaa">>&"user_token"=<<"aaaaaaaaaaaaaaaa">>&"car_id"=<<CurrentRow.Item("car_id").ToString>>&"category_id"=<<CurrentRow.Item("category_id").ToString>>&"quality"=<<CurrentRow.Item("quality").ToString>>&"status"=<<CurrentRow.Item("status").ToString>>&"position"=<<CurrentRow.Item("position").ToString>>&"notes"=<<CurrentRow.Item("notes").ToString>>&"manufacturer_code"=<<CurrentRow.Item("manufacturer_code").ToString>>&"visible_code"=<<CurrentRow.Item("visable_code").ToString>>&"other_code"=<<CurrentRow.Item("other_code").ToString>>&"internal_notes"=<<CurrentRow.Item("internal_notes").ToString>>&"photo"=<<CurrentRow.Item("photo").ToString>>&"photos[]"=<<CurrentRow.Item("photos_1").ToString>>&"photos[]"=<<CurrentRow.Item("photos_2").ToString>>&"photos[]"=<<CurrentRow.Item("photos_3").ToString>>&"photos[]"=<<CurrentRow.Item("photos_4").ToString>>&"price"=<<CurrentRow.Item("price").ToString>>

```

Im getting a lot of theese errors:

 ![image](https://global.discourse-cdn.com/uipath/original/4X/f/f/2/ff22cc304af747bab7c34490e27ce9bb9946dbb5.png)

---

<div class="post-metadata">

**Author:** ![lrtetala](https://avatars.discourse-cdn.com/v4/letter/l/e19b73/32.png) [@lrtetala](https://forum.uipath.com/u/lrtetala)\
**Post date:** [July 17, 2023, 9:02am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/9 "2023-07-17T09:02:14Z")

</div>

Hi @Povilas_Jonikas

To construct the URL-encoded query string, you can use the `String.Format` method or string concatenation to build the body as a string. Here’s an example:

```auto
"username=signeda" +
"&password=" + Uri.EscapeDataString("aaaaaaaaaaa") +
"&user_token=" + Uri.EscapeDataString("aaaaaaaaaaaaaaaa") +
"&car_id=" + Uri.EscapeDataString(CurrentRow.Item("car_id").ToString) +
"&category_id=" + Uri.EscapeDataString(CurrentRow.Item("category_id").ToString) +
"&quality=" + Uri.EscapeDataString(CurrentRow.Item("quality").ToString) +
"&status=" + Uri.EscapeDataString(CurrentRow.Item("status").ToString) +
"&position=" + Uri.EscapeDataString(CurrentRow.Item("position").ToString) +
"&notes=" + Uri.EscapeDataString(CurrentRow.Item("notes").ToString) +
"&manufacturer_code=" + Uri.EscapeDataString(CurrentRow.Item("manufacturer_code").ToString) +
"&visible_code=" + Uri.EscapeDataString(CurrentRow.Item("visible_code").ToString) +
"&other_code=" + Uri.EscapeDataString(CurrentRow.Item("other_code").ToString) +
"&internal_notes=" + Uri.EscapeDataString(CurrentRow.Item("internal_notes").ToString) +
"&photo=" + Uri.EscapeDataString(CurrentRow.Item("photo").ToString) +
"&photos[]=" + Uri.EscapeDataString(CurrentRow.Item("photos_1").ToString) +
"&photos[]=" + Uri.EscapeDataString(CurrentRow.Item("photos_2").ToString) +
"&photos[]=" + Uri.EscapeDataString(CurrentRow.Item("photos_3").ToString) +
"&photos[]=" + Uri.EscapeDataString(CurrentRow.Item("photos_4").ToString) +
"&price=" + Uri.EscapeDataString(CurrentRow.Item("price").ToString)

```

In this example, I have removed the `<< >>` and double `&` characters. The `Uri.EscapeDataString` method is used to properly URL-encode the values and handle any special characters within them.

I hope it works!!

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [July 17, 2023, 9:07am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/10 "2023-07-17T09:07:37Z")

</div>

@Povilas_Jonikas

for ease you can copy the raw body from your postman and use the same here

cheers

---

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 17, 2023, 9:17am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/11 "2023-07-17T09:17:16Z")

</div>

Thanks for the suggestion, but I tried it already, the postman body failed, got several errors.

---

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 17, 2023, 9:18am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/12 "2023-07-17T09:18:24Z")

</div>

Thanks a lot, I get 0 errors now. But one more question, what about the headers? Should they be in the raw body 2? And what about the http request activity section where there are “Headers” and “parameters”, should they be declared there also? Or should i leave theese parts blank?

---

<div class="post-metadata">

**Author:** ![Anil\_G](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/anil_g/32/524291_2.png) [@Anil\_G](https://forum.uipath.com/u/Anil_G)\
**Post date:** [July 17, 2023, 9:21am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/13 "2023-07-17T09:21:33Z")

</div>

@Povilas_Jonikas

Ideally after copying the text from there you need surround everything with double quotes and all the double quotes inside body needs to be replaced with double double quotes to escape…

Anyways good you got the body now

parameters are not needed unless you dont use variables in body…

and for headers …headers will be same as what you need

cheers

---

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 17, 2023, 9:25am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/14 "2023-07-17T09:25:27Z")

</div>

Holly molly, it worked. I just did the test run and it worked perfectly using the Body way. You guys are insane. Im really thankful to both of you. You both guys helped me insanely. THANKS A LOT!

---

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 17, 2023, 9:26am UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/15 "2023-07-17T09:26:53Z")

</div>

Both @Anil_G and @lrtetala were crucial with their knowlage towards my problem. Both of u guys are legends. Thanks!

---

<div class="post-metadata">

**Author:** ![Povilas\_Jonikas](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/povilas_jonikas/32/268220_2.png) [@Povilas\_Jonikas](https://forum.uipath.com/u/Povilas_Jonikas)\
**Post date:** [July 19, 2023, 1:27pm UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/16 "2023-07-19T13:27:46Z")

</div>

> [@lrtetala](#):
>
> Hi @Povilas_Jonikas
> 
> To construct the URL-encoded query string, you can use the `String.Format` method or string concatenation to build the body as a string. Here’s an example:
> 
> ```auto
> "username=signeda" +
> "&password=" + Uri.EscapeDataString("aaaaaaaaaaa") +
> "&user_token=" + Uri.EscapeDataString("aaaaaaaaaaaaaaaa") +
> "&car_id=" + Uri.EscapeDataString(CurrentRow.Item("car_id").ToString) +
> "&category_id=" + Uri.EscapeDataString(CurrentRow.Item("category_id").ToString) +
> "&quality=" + Uri.EscapeDataString(CurrentRow.Item("quality").ToString) +
> "&status=" + Uri.EscapeDataString(CurrentRow.Item("status").ToString) +
> "&position=" + Uri.EscapeDataString(CurrentRow.Item("position").ToString) +
> "&notes=" + Uri.EscapeDataString(CurrentRow.Item("notes").ToString) +
> "&manufacturer_code=" + Uri.EscapeDataString(CurrentRow.Item("manufacturer_code").ToString) +
> "&visible_code=" + Uri.EscapeDataString(CurrentRow.Item("visible_code").ToString) +
> "&other_code=" + Uri.EscapeDataString(CurrentRow.Item("other_code").ToString) +
> "&internal_notes=" + Uri.EscapeDataString(CurrentRow.Item("internal_notes").ToString) +
> "&photo=" + Uri.EscapeDataString(CurrentRow.Item("photo").ToString) +
> "&photos[]=" + Uri.EscapeDataString(CurrentRow.Item("photos_1").ToString) +
> "&photos[]=" + Uri.EscapeDataString(CurrentRow.Item("photos_2").ToString) +
> "&photos[]=" + Uri.EscapeDataString(CurrentRow.Item("photos_3").ToString) +
> "&photos[]=" + Uri.EscapeDataString(CurrentRow.Item("photos_4").ToString) +
> "&price=" + Uri.EscapeDataString(CurrentRow.Item("price").ToString)
> 
> ```
> 
> In this example, I have removed the `<< >>` and double `&` characters. The `Uri.EscapeDataString` method is used to properly URL-encode the values and handle any special characters within them.
> 
> I hope it works!!

Hello yet again. Because you helped me once, i hope you will help me for the last time with this topic. Can you please tell me, how can I put instead of CurrentRow.Item(“phhotos\_4”) a variable called part\_photos\_gallery4? It has the same exact value as if CurrentRow.Item(“phhotos\_4”) would have, but its not looped on a For each activity. The format of the value is a string put into another string variable. If you could, please help me with this problem, will be forever grateful 🙂

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [July 22, 2023, 1:27pm UTC](https://forum.uipath.com/t/http-request-wizard-parameters-with-the-same-name/563397/17 "2023-07-22T13:27:58Z")

</div>

Closed on July 22, 2023, 1:27pm UTC

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