Skip to content

Instantly share code, notes, and snippets.

@Kalmuraee
Created May 7, 2020 03:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kalmuraee/0e4d593ba3f3a03c26d3bfc6de41289a to your computer and use it in GitHub Desktop.
Save Kalmuraee/0e4d593ba3f3a03c26d3bfc6de41289a to your computer and use it in GitHub Desktop.
app.get("/meeting", (req, res, next) => {
try {
var options = {
method: "POST",
url:
"https://api.zoom.us/v2/users/${userID}/meetings", // Use process.env.userId
headers: {
Authorization:
"Bearer ${token}",
"Content-Type": "application/json"
},
body: {
topic: "Meeting Topic",
type: 1,
password: "",
agenda: "Meeting Agenda",
settings: {
host_video: true,
participant_video: true,
join_before_host: true,
mute_upon_entry: true,
watermark: true,
use_pmi: true,
approval_type: 2,
audio: "voip",
auto_recording: "none",
enforce_login: false
}
},
json: true
};
request(options, function(error, response, body) {
if (error) throw new Error(error);
res.setHeader("Access-Control-Allow-Origin", "*");
body.signature = generateSignature(API_KEY, API_SECRET, body.id, 1);
setTimeout((function() {res.send(body)}), 10000);
});
} catch (err) {
console.log(err);
console.log("Error Creating a meeting");
res.send(err);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment