# WebRequest and parameters

**URL:** <https://community.easymorph.com/t/webrequest-and-parameters/2758>\
**Category:** General Q&A\
**Created:** [May 26, 2021, 3:55am UTC](https://community.easymorph.com/t/webrequest-and-parameters/2758 "2021-05-26T03:55:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![flowy](https://community.easymorph.com/letter_avatar_proxy/v4/letter/f/e95f7d/32.png) [@flowy](https://community.easymorph.com/u/flowy)\
**Post date:** [May 26, 2021, 3:55am UTC](https://community.easymorph.com/t/webrequest-and-parameters/2758/1 "2021-05-26T03:55:19Z")

</div>

Trying to use the Web request to get access to a REST api. I have it working when I paste the json string as a text. Although I have some variables that come from the columns that I've loaded from SQL table. Two questions. Is there a way to somehow save the column (1 row) into a parameter then use that parameter in the Body as Text? I tried but not sure if its not allowed.

Second question is if I can't do it that way and instead i have to create my own json string, (i looked over your support topic) I need the JSON to be a specific tree. And can't seem to figure out how to get it to work out.

Sample of json string:  
{  
"Messages": [  
{  
"From": {  
"Email": "[testme@yahoo.com](mailto:testme@yahoo.com)",  
"Name": "Test"  
},  
"To": [  
{  
"Email": "[testme2@yahoo.com](mailto:testme2@yahoo.com)",  
"Name": "Test Me2"  
}  
],  
"Subject": "Hi!",  
"TextPart": "Hello!"

```
    }
]

```

}

Thanks!  
Flowy

---

<div class="post-metadata">

**Author:** ![Florent](https://community.easymorph.com/letter_avatar_proxy/v4/letter/f/e19b73/32.png) [@Florent](https://community.easymorph.com/u/Florent)\
**Post date:** [May 26, 2021, 11:39am UTC](https://community.easymorph.com/t/webrequest-and-parameters/2758/2 "2021-05-26T11:39:59Z")

</div>

Hello,

To call web service with REST api, I use module like :

 ![image](https://community.easymorph.com/uploads/default/original/2X/4/4d23a96b624005f4c8380b2fb8094eda32f28f7e.png)

 ![image](https://community.easymorph.com/uploads/default/original/2X/a/ae2da003b5688a2743c837c1dd20587ce16e2630.png)

You can use action "Construct JSON" several time to create this JSON.

---

<div class="post-metadata">

**Author:** ![dgudkov](https://community.easymorph.com/user_avatar/community.easymorph.com/dgudkov/32/5_2.png) [@dgudkov](https://community.easymorph.com/u/dgudkov)\
**Post date:** [May 26, 2021, 4:59pm UTC](https://community.easymorph.com/t/webrequest-and-parameters/2758/3 "2021-05-26T16:59:47Z")

</div>

> [@flowy](#):
>
> Is there a way to somehow save the column (1 row) into a parameter then use that parameter in the Body as Text?

Yes, you can use the "Iterate web request" action. It allows specifying the request body from a column. Since the table has only 1 row, the action will perform exactly 1 request.

> [@flowy](#):
>
> Second question is if I can’t do it that way and instead i have to create my own json string, (i looked over your support topic) I need the JSON to be a specific tree.

You can construct JSONs of any complexity using the "Construct JSON" action. See below an example that constructs the sample JSON that you provided:

[construct-json.morph](https://community.easymorph.com/uploads/short-url/f3hmr08DK3VNSthHZQFUhtSu6tK.morph) (4.4 KB)

 ![image](https://community.easymorph.com/uploads/default/original/2X/4/4436a49024fddd22447c9fc97878f6af7bde6808.png)

---

<div class="post-metadata">

**Author:** ![flowy](https://community.easymorph.com/letter_avatar_proxy/v4/letter/f/e95f7d/32.png) [@flowy](https://community.easymorph.com/u/flowy)\
**Post date:** [May 28, 2021, 5:26pm UTC](https://community.easymorph.com/t/webrequest-and-parameters/2758/4 "2021-05-28T17:26:11Z")

</div>

Thanks Dmitry!!! I'll give this a try today!

---

<div class="post-metadata">

**Author:** ![flowy](https://community.easymorph.com/letter_avatar_proxy/v4/letter/f/e95f7d/32.png) [@flowy](https://community.easymorph.com/u/flowy)\
**Post date:** [June 9, 2021, 11:10pm UTC](https://community.easymorph.com/t/webrequest-and-parameters/2758/5 "2021-06-09T23:10:00Z")

</div>

Hi Dmitry!

I couldn't open the sample program since we have the older version of easymorph. But I figured it out from the picture you provided.

Worked great with the list creation and then calling the rest API directly!

Thanks  
Flowy

---

<div class="post-metadata">

**Author:** ![flowy](https://community.easymorph.com/letter_avatar_proxy/v4/letter/f/e95f7d/32.png) [@flowy](https://community.easymorph.com/u/flowy)\
**Post date:** [June 13, 2021, 11:03pm UTC](https://community.easymorph.com/t/webrequest-and-parameters/2758/6 "2021-06-13T23:03:21Z")

</div>

Dmitry,

One more related question. Let's say I have a list of To people. Unfortunately I can't set it up to be an JSON array of multiple emails because I want to customize it to each user. I have a list that I'm pulling for SQL so lets say like 1-10 users (name, and emails). I want to create each row into a JSON string. I need to iterate the results table above but grabbing the json string row by row from the To List. Possible?

Thanks  
Flowy

---

<div class="post-metadata">

**Author:** ![dgudkov](https://community.easymorph.com/user_avatar/community.easymorph.com/dgudkov/32/5_2.png) [@dgudkov](https://community.easymorph.com/u/dgudkov)\
**Post date:** [June 14, 2021, 8:34am UTC](https://community.easymorph.com/t/webrequest-and-parameters/2758/7 "2021-06-14T08:34:38Z")

</div>

Not sure I understand your question precisely, but what I read should be possible to do using iterations.

---

<div class="post-metadata">

**Author:** ![flowy](https://community.easymorph.com/letter_avatar_proxy/v4/letter/f/e95f7d/32.png) [@flowy](https://community.easymorph.com/u/flowy)\
**Post date:** [June 17, 2021, 6:49pm UTC](https://community.easymorph.com/t/webrequest-and-parameters/2758/8 "2021-06-17T18:49:03Z")

</div>

Actually your right Iterations worked great! 🙂  
thanks Dmitry!

Flowy
