Created
May 7, 2020 03:11
-
-
Save Kalmuraee/0e4d593ba3f3a03c26d3bfc6de41289a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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