Hello,
Could you please help me with the following code?
Each time i write settings on the payload, the script doen’t work.
I would like to add alternative host and waiting room
var userId = ‘myuserid’;
var url = ‘https://api.zoom.us/v2/users/’ + userId + ‘/meetings’;
var token = ‘mytoken’;
var type = ‘2’;
var settings = {
‘waiting_room’: true,
‘alternative_hosts’: alternativeHost,
};
var timezone = ‘Europe/Paris’;
var payload = ‘{“topic”: "’ + topic
- ‘",“type”: "’ + type
- ‘",“start_time”: "’ + startTime
- ‘",“duration”: "’ + duration
- ‘",“timezone”: "’ + timezone
- ‘",“settings”: "’ + settings
+’"}’;
var options =
{
‘method’ : ‘POST’,
‘followRedirects’ : true,
‘muteHttpExceptions’: true,
"headers": {
"Accept": "application/json, application/xml",
"Content-Type": "application/json",
"Authorization": "Bearer " + token
},
'payload': payload
};
var response = UrlFetchApp.fetch(url,options);
var json = response.getContentText();
var data = JSON.parse(json);
return data.join_url;
}