# CORs error while Zoom API call from ReactJS

**URL:** <https://devforum.zoom.us/t/cors-error-while-zoom-api-call-from-reactjs/26515>\
**Category:** API and Webhooks\
**Created:** [August 7, 2020, 4:43am UTC](https://devforum.zoom.us/t/cors-error-while-zoom-api-call-from-reactjs/26515 "2020-08-07T04:43:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijay.singh](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vijay.singh/32/9055_2.png) [@vijay.singh](https://devforum.zoom.us/u/vijay.singh)\
**Post date:** [August 7, 2020, 4:43am UTC](https://devforum.zoom.us/t/cors-error-while-zoom-api-call-from-reactjs/26515/1 "2020-08-07T04:43:54Z")

</div>

**Description**  
I am using ReactJS for front end and Django for back end. I have to integrate Zoom WEB SDK and also have to use Zoom APIs(for creating meetings, and other purposes which aren’t available via SDK).

On making the API call from ReactJS I am getting the CORs error in my browser console.

**Error**  
Access to XMLHttpRequest at ‘[https://api.zoom.us/v2/users/{USER\_ID}/meetings](https://api.zoom.us/v2/users/%7BUSER_ID%7D/meetings)’ from origin ‘[http://localhost:8000](http://localhost:8000)’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.

App Type is JWT.  
The JWT token is being generated from the back end i.e Django and I am passing it in Authorization header.

API endpoint: [https://api.zoom.us/v2/users/{USER\_ID}/meetings](https://api.zoom.us/v2/users/%7BUSER_ID%7D/meetings)

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:

1. Back end code generates JWT token and passes to ReactJS
2. On button click to create meeting below API POST call is made.

```auto
const config = {
      headers: {
        Authorization: `Bearer ${jwt_token}`,
        'Content-Type': 'application/json'
      },
    };
const data = {
      'topic': 'Sample Discussion',
      'type': '1',
      'duration': '60',
      'password': 'IamThePassword321',
      'agenda': 'To discuss various plans meeting',
      'settings': {
        'host_video': 'true',
        'participant_video': 'true',
        'join_before_host': 'true',
        'mute_upon_entry': 'true',
        'watermark': 'true',
        'use_pmi': 'false',
        'approval_type': '0',
        'audio': 'both',
        'auto_recording': 'cloud',
      }
    };
const url = 'https://api.zoom.us/v2/users/{USER_ID}/meetings';
return axios({
      config,
      url: url,
      method: 'post',
      data: data
    });

```

**Screenshots**

 ![zoomAPIerror](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/e/ef665f78cbf883fd15210e1838756288a297eb4d.png)

---

<div class="post-metadata">

**Author:** ![vijay.singh](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vijay.singh/32/9055_2.png) [@vijay.singh](https://devforum.zoom.us/u/vijay.singh)\
**Post date:** [August 7, 2020, 1:26pm UTC](https://devforum.zoom.us/t/cors-error-while-zoom-api-call-from-reactjs/26515/2 "2020-08-07T13:26:04Z")

</div>

It seems that calling Zoom APIs from front end will always throw this issue, so I moved the API call to my back end server from NodeJS where the API calls are being done successfully.

Also make sure the password for the meeting is set to string that has less than 10 characters or else will end up fail in API call (as in my case I have set password to “IamThePassword321” and I was getting error due to this from Node server.

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 10, 2020, 6:49am UTC](https://devforum.zoom.us/t/cors-error-while-zoom-api-call-from-reactjs/26515/3 "2020-08-10T06:49:08Z")

</div>

Hey @vijay.singh,

Thanks for sharing your solution! 🙂

Yes, the Zoom API must be called from the server side / backend. If called from the client side / frontend, you will get CORs errors.

-Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 20, 2020, 6:49am UTC](https://devforum.zoom.us/t/cors-error-while-zoom-api-call-from-reactjs/26515/4 "2020-08-20T06:49:09Z")

</div>

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