Hi All
Can any one help me out
Description/Error
Failed to load resource. The server responded with a status of 403
Web JS SDK
Rest API call from Local web project for create meeting generates error " Failed to load resource 403 "
Steps to reproduce the behavior:
https://api.zoom.us/v2/users/{userId}/meetings
I used the same code that generated in postman
var data = JSON.stringify({
"host_id": "my email id",
"topic": "my first zoom meeting",
"type": "2"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://api.zoom.us/v2/users/{email id}/meetings");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("authorization", "Bearer JWT Token");
xhr.send(data);
tommy
(Tommy Gaessler)
November 25, 2019, 9:16pm
2
Hey @palanirajan70 , thanks for posting and using Zoom!
I believe this is a Cors issue . Zoom does not allow the frontend to make requests to our API.
I suggest using a backend Node.js Server to make requests to the Zoom API. For example:
Your Frontend and Web SDK makes http request to your backed server > your backend server makes request to Zoom API > Zoom API responds back to your backend server > your backend server responds back to your Frontend and Web SDK.
Thanks @gokul ,
First of all, calling Zoom APIs via the frontend (jQuery) is not supported. I suggest creating a Node.js server to make http requests to the Zoom API.
What is your full use case so I can provide advice on what type of Zoom App to create (JWT vs. OAuth )?
Nevertheless, I have fixed your code, and now you can get an access_token, but when you call the create meeting endpoint you will get a Invalid CORS request error because we do not support https://cors-anywhere.herokuapp.com/
(…
Let me know if this helps!
Thanks,
Tommy
Thanks @tommy .
Hi Tommy.It Works.Thank you for your timely suggestion.
1 Like