# Alternative\_host API and waiting room

**URL:** <https://devforum.zoom.us/t/alternative-host-api-and-waiting-room/14195>\
**Category:** API and Webhooks\
**Created:** [April 21, 2020, 9:52am UTC](https://devforum.zoom.us/t/alternative-host-api-and-waiting-room/14195 "2020-04-21T09:52:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![eduardo.redondo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eduardo.redondo/32/6590_2.png) [@eduardo.redondo](https://devforum.zoom.us/u/eduardo.redondo)\
**Post date:** [April 21, 2020, 9:52am UTC](https://devforum.zoom.us/t/alternative-host-api-and-waiting-room/14195/1 "2020-04-21T09:52:07Z")

</div>

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/](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;  
}

---

<div class="post-metadata">

**Author:** ![michael.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/michael.zoom/32/37213_2.png) [@michael.zoom](https://devforum.zoom.us/u/michael.zoom)\
**Post date:** [April 21, 2020, 5:44pm UTC](https://devforum.zoom.us/t/alternative-host-api-and-waiting-room/14195/2 "2020-04-21T17:44:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![eduardo.redondo](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/eduardo.redondo/32/6590_2.png) [@eduardo.redondo](https://devforum.zoom.us/u/eduardo.redondo)\
**Post date:** [April 21, 2020, 7:58pm UTC](https://devforum.zoom.us/t/alternative-host-api-and-waiting-room/14195/3 "2020-04-21T19:58:09Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [April 22, 2020, 9:55pm UTC](https://devforum.zoom.us/t/alternative-host-api-and-waiting-room/14195/4 "2020-04-22T21:55:11Z")

</div>

Hey @eduardo.redondo,

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

Can you try passing in valid JSON like:

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

```

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 8:53pm UTC](https://devforum.zoom.us/t/alternative-host-api-and-waiting-room/14195/5 "2020-08-21T20:53:25Z")

</div>

Closed on August 21, 2020, 8:53pm UTC


