-
Notifications
You must be signed in to change notification settings - Fork 0
/
zoom.js
38 lines (31 loc) · 927 Bytes
/
zoom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require('dotenv').config();
const request = require('request');
const zoomScheme = require('./zoom-meeting-scheme');
const logger = require('./logger');
logger.logTime(false);
let authToken = process.env.AUTH_TOKEN;
authToken = process.env.JWT;
let userId = process.env.USER_ID;
let url = 'https://api.zoom.us/v2/users/me/meetings';
let data = zoomScheme.getDefault('Test Call');
request.post({
url: url,
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + authToken
},
body: JSON.stringify(data),
}, function (error, response, body) {
//console.log(body);
if (error) {
logger.error(error)
} else {
let data = JSON.parse(body);
if (data["join_url"]) {
let joinUrl = data["join_url"];
logger.info('Join URL: ' + joinUrl)
} else {
logger.error('Join URL not found')
}
}
});