Alternative_host API and waiting room

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;
}

Hi @eduardo.redondo, could you include the error code you’re receiving for this request?

Thanks Michael,

I’m doing this on google apps script, don’t really get an error in syntaxe but
Each time i add the line

  • ‘",“settings”: "’ + settings
    the script doesn’t get me the join_url link

Am i doing well?
thanks for your help,
by the way, how can i get the complete invitation link description?

Hey @eduardo.redondo,

I think you are passing in the settings object as a string.

Can you try passing in valid JSON like:

{
  "topic": "topic",
  "type": "type",
  "start_time": "startTime",
  "duration": "duration",
  "timezone": "timezone",
  "settings": {
    "waiting_room": true,
    "alternative_hosts": "email@domain.com",
  }
};

Thanks,
Tommy