# How to write JSON in body of HTTP request for {urlload} function

**URL:** <https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792>\
**Category:** Questions and Help\
**Created:** [July 3, 2021, 5:20pm UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792 "2021-07-03T17:20:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shinta\_Nishino](https://community.blaze.today/user_avatar/community.blaze.today/shinta_nishino/32/1796_2.png) [@Shinta\_Nishino](https://community.blaze.today/u/Shinta_Nishino)\
**Post date:** [July 3, 2021, 5:20pm UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/1 "2021-07-03T17:20:44Z")

</div>

Hi,  
I am trying to create a meeting at Zoom by API using {urlload} function (code is below) but I get 403 error (URL Contents:Invalid CORS request). I think the problem would be that I fail in sending JSON in the body of HTTP POST request. (c.f. [Zoom API doc](https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate))  
I would like to know how to send JSON in the body of HTTP POST request or if there is an alternative way.

# Code

```
{urlload: https://api.zoom.us/v2/users/xxxx/meetings; 
headers=["Authorization"="Bearer XXXX, "Content-Type"="application/json"]; 
method=POST; 
body={=body};
start=()->["loading"=yes];
done=(contents, status)->["loading"=no, "contents"=contents, "status"=status]
}

{if: loading}
Loading URL...
{else}
Request Status:
{=status}
URL Contents:
{=contents}
{endif}

{body=
{
 "topic": "test",
 "type": "2",
 "start_time": "2021-07-05T10:00:00Z",
 "duration": "10",
 "schedule_for": "",
 "password": "",
 "agenda": ""
}
}

```

# I tried

- I succeeded in creating a meeting by API in another app (Postman:[https://web.postman.co/](https://web.postman.co/)). So, my JSON works in body of HTTP POST request at Postman.
- I succeeded in sending GET request with Text Blaze. So, the header part works well at Text Blaze.
- I replaced {=body} with {clipboard} (`body={clipboard}`) and copied JSON code before snippet, but did not work.

---

<div class="post-metadata">

**Author:** ![Cedric\_Debono\_Blaze](https://community.blaze.today/user_avatar/community.blaze.today/cedric_debono_blaze/32/1672_2.png) [@Cedric\_Debono\_Blaze](https://community.blaze.today/u/Cedric_Debono_Blaze)\
**Post date:** [July 5, 2021, 9:37am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/2 "2021-07-05T09:37:07Z")

</div>

Ok, I'm gonna have to hide behind @scott for this one 😅

---

<div class="post-metadata">

**Author:** ![scott](https://community.blaze.today/user_avatar/community.blaze.today/scott/32/30_2.png) [@scott](https://community.blaze.today/u/scott)\
**Post date:** [July 5, 2021, 9:45am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/3 "2021-07-05T09:45:54Z")

</div>

I think something like this should work. Does it not?

{urlload: [https://api.zoom.us/v2/users/xxxx/meetings](https://api.zoom.us/v2/users/xxxx/meetings);  
headers=["Authorization":"Bearer XXXX", "Content-Type":"application/json"];  
method=POST;  
body={  
"topic": "test",  
"type": "2",  
"start\_time": "2021-07-05T10:00:00Z",  
"duration": "10",  
"schedule\_for": "",  
"password": "",  
"agenda": ""  
};  
start=()-\>["loading":yes];  
done=(contents, status)-\>["loading":no, "contents":contents, "status":status]  
}

---

<div class="post-metadata">

**Author:** ![Shinta\_Nishino](https://community.blaze.today/user_avatar/community.blaze.today/shinta_nishino/32/1796_2.png) [@Shinta\_Nishino](https://community.blaze.today/u/Shinta_Nishino)\
**Post date:** [July 5, 2021, 9:59am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/4 "2021-07-05T09:59:24Z")

</div>

Hi Scott,

I tired but did not work....

---

<div class="post-metadata">

**Author:** ![scott](https://community.blaze.today/user_avatar/community.blaze.today/scott/32/30_2.png) [@scott](https://community.blaze.today/u/scott)\
**Post date:** [July 5, 2021, 10:23am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/5 "2021-07-05T10:23:54Z")

</div>

What error do you get?

---

<div class="post-metadata">

**Author:** ![Shinta\_Nishino](https://community.blaze.today/user_avatar/community.blaze.today/shinta_nishino/32/1796_2.png) [@Shinta\_Nishino](https://community.blaze.today/u/Shinta_Nishino)\
**Post date:** [July 5, 2021, 10:48am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/6 "2021-07-05T10:48:06Z")

</div>

Hi Scott,  
I receive this error

```
Request Status:
403
URL Contents:
Invalid CORS request

```

I sent the same JSON via Postman and it works.

---

<div class="post-metadata">

**Author:** ![scott](https://community.blaze.today/user_avatar/community.blaze.today/scott/32/30_2.png) [@scott](https://community.blaze.today/u/scott)\
**Post date:** [July 5, 2021, 11:41am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/7 "2021-07-05T11:41:01Z")

</div>

You could trying adding "Origin"="null" or "Origin"="" to the headers of the urlload command. There is a small chance it may address it.

Looking at the zoom forums seems like a number of other people have run into this issue.

---

<div class="post-metadata">

**Author:** ![Shinta\_Nishino](https://community.blaze.today/user_avatar/community.blaze.today/shinta_nishino/32/1796_2.png) [@Shinta\_Nishino](https://community.blaze.today/u/Shinta_Nishino)\
**Post date:** [July 9, 2021, 11:46am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/8 "2021-07-09T11:46:30Z")

</div>

Hi Scott,

Thank you for directing me to look to Zoom Forum!  
I tried to add "Origin"="null", "Origin"="" and also "Origin"="[https://developer.zoom.us](https://developer.zoom.us)" following [Zoom Forum](https://devforum.zoom.us/t/zoom-api-post-sending-invalid-cors-request/920) in the header but did not work.

Based on [this post](https://devforum.zoom.us/t/zoom-api-post-sending-invalid-cors-request/920/5) at Zoom Forum in 2018, they said API call should be made from a server.

> When calling the API, you’ll want to make sure that you are making the call from your server instead of the client. When making API calls from a client, you’ll run into CORS errors.

I think Text Blaze call API from a client? If so I assume an interceptor? (I do not know exactly) is needed to call API from Text Blaze (Postman solved invalid CORS request by providing [interceptor](https://learning.postman.com/docs/sending-requests/capturing-request-data/interceptor/) extension to chrome) to Zoom?

I read these Zoom Forum posts, too

> **[Unable to Create a Meeting For User](https://devforum.zoom.us/t/unable-to-create-a-meeting-for-user/34639)**
>
> I am integrating code for Create a meeting API with one of my Web Application, I am passing all the data in JSON format to the API in Body, but getting “Invalid CORS request” like that Please find the below format (Body) for your reference. ...

> **[Getting Invalid CORS request](https://devforum.zoom.us/t/getting-invalid-cors-request/30493)**
>
> Description I am trying to create a meeting from Postman on my local machine. The following is the JSON I am using { "topic": "Test Meeting", "type": 2, "start\_time": "2019-09-20T16:54:14Z", "duration": 60, "schedule\_for": "email", ...

---

<div class="post-metadata">

**Author:** ![Shinta\_Nishino](https://community.blaze.today/user_avatar/community.blaze.today/shinta_nishino/32/1796_2.png) [@Shinta\_Nishino](https://community.blaze.today/u/Shinta_Nishino)\
**Post date:** [July 9, 2021, 11:51am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/9 "2021-07-09T11:51:20Z")

</div>

thank you for your reply though 😆

---

<div class="post-metadata">

**Author:** ![Shinta\_Nishino](https://community.blaze.today/user_avatar/community.blaze.today/shinta_nishino/32/1796_2.png) [@Shinta\_Nishino](https://community.blaze.today/u/Shinta_Nishino)\
**Post date:** [August 2, 2021, 10:35am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/10 "2021-08-02T10:35:26Z")

</div>

Hi @scott,  
According to Zoom, their API shall be called from backend(screen shot is attached: [Zoom API POST sending Invalid CORS request - #9 by shinta - API and Webhooks - Zoom Developer Forum](https://devforum.zoom.us/t/zoom-api-post-sending-invalid-cors-request/920/9)).

I think Text Blaze calls API from frontend (Google Chrome browser), doesn't it? If so are there any ways to call API from backend?

 ![image](https://community.blaze.today/uploads/default/original/2X/f/f10521f0a32ca6dafbd38e29d3c61dfd62a43888.png)

---

<div class="post-metadata">

**Author:** ![scott](https://community.blaze.today/user_avatar/community.blaze.today/scott/32/30_2.png) [@scott](https://community.blaze.today/u/scott)\
**Post date:** [August 2, 2021, 2:27pm UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/11 "2021-08-02T14:27:23Z")

</div>

Hi,

We don't provide a backend for {urlload} requests, they are instead made from the extension.

If you really wanted the request to come from a server, you could create your own backend and then have Text Blaze make requests to that.

---

<div class="post-metadata">

**Author:** ![Shinta\_Nishino](https://community.blaze.today/user_avatar/community.blaze.today/shinta_nishino/32/1796_2.png) [@Shinta\_Nishino](https://community.blaze.today/u/Shinta_Nishino)\
**Post date:** [August 5, 2021, 9:45am UTC](https://community.blaze.today/t/how-to-write-json-in-body-of-http-request-for-urlload-function/9792/12 "2021-08-05T09:45:20Z")

</div>

Hi Scott,  
Noted! Thank you for your comment. I will think about creating intermediate web app.
