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’ from origin ‘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
How To Reproduce (If applicable)
Steps to reproduce the behavior:
- Back end code generates JWT token and passes to ReactJS
- On button click to create meeting below API POST call is made.
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