# Not able to join the meeting as host in web SDK 1.9.0

**URL:** <https://devforum.zoom.us/t/not-able-to-join-the-meeting-as-host-in-web-sdk-1-9-0/49634>\
**Category:** Web\
**Created:** [May 5, 2021, 1:37pm UTC](https://devforum.zoom.us/t/not-able-to-join-the-meeting-as-host-in-web-sdk-1-9-0/49634 "2021-05-05T13:37:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![akshay.rao](https://avatars.discourse-cdn.com/v4/letter/a/8c91f0/32.png) [@akshay.rao](https://devforum.zoom.us/u/akshay.rao)\
**Post date:** [May 5, 2021, 1:37pm UTC](https://devforum.zoom.us/t/not-able-to-join-the-meeting-as-host-in-web-sdk-1-9-0/49634/1 "2021-05-05T13:37:00Z")

</div>

**Description**  
I am trying to join a meeting through the participant URL and trying to assign role as Host by passing the role as 1 in the code as shown below

Code to join meeting -

```javascript
 function StartMeeting() {
        var meetConfig = {
            apiKey: API_KEY,
            signature: API_Signature,
            meetingNumber: MeetingId,
            userName: Name,
            passWord: Password,
            //leaveUrl: "http://localhost:57898/Zoom/ZoomMain.html",
            leaveUrl: leavepath,
            role: Role,
            lang: culture
        };
        if (meetConfig.leaveUrl) {
            ZoomMtg.init({
                leaveUrl: meetConfig.leaveUrl,
                success: function () {
                    ZoomMtg.i18n.load(meetConfig.lang);
                    ZoomMtg.i18n.reload(meetConfig.lang);
                    ZoomMtg.reRender({ "lang": meetConfig.lang});
                    ZoomMtg.join(
                        {
                            meetingNumber: meetConfig.meetingNumber,
                            userName: meetConfig.userName,
                            signature: meetConfig.signature,
                            apiKey: meetConfig.apiKey,
                            passWord: meetConfig.passWord,
                            role: meetConfig.Role,
                            success: function (res) {
                                if (Action == "EndMeeting") {
                                    ZoomMtg.leaveMeeting({});
                                    console.log('Leave meeting success');
                                } else if (Action == "StartTestMeeting") {
                                    $("#nav-tool").hide();
                                    console.log('Join meeting success');
                                    HideJoinAudio();
                                } else {
                                    $("#nav-tool").hide();
                                    console.log('Join meeting success');
                                    debugger;

                                    //var obj = ZoomMtg.getInstance();
                                    //var inMeeting = obj.getInMeetingService();
                                    //inMeeting.makeHost(meetConfig.userName);
                                    HideJoinAudio();
                                    EnableButtonState();
                                }
                            },
                            error: function (res) {
                                console.log(res);
                            }
                        }
                    );
                },
                error: function (res) {
                    console.log(res);
                }
            });
        }

    }

```

Code to generate token - C#

```auto
static readonly char[] padding = { '=' };

        public static long ToTimestamp(DateTime value)
        {
            long epoch = (value.Ticks - 621355968000000000) / 10000;
            return epoch;
        }

public static string GenerateToken(string apiKey, string apiSecret, string meetingNumber, string ts, string role)
        {
            string message = String.Format("{0}{1}{2}{3}", apiKey, meetingNumber, ts, role);
            apiSecret = apiSecret ?? "";
            var encoding = new System.Text.ASCIIEncoding();
            byte[] keyByte = encoding.GetBytes(apiSecret);
            byte[] messageBytesTest = encoding.GetBytes(message);
            string msgHashPreHmac = System.Convert.ToBase64String(messageBytesTest);
            byte[] messageBytes = encoding.GetBytes(msgHashPreHmac);
            using (var hmacsha256 = new HMACSHA256(keyByte))
            {
                byte[] hashmessage = hmacsha256.ComputeHash(messageBytes);
                string msgHash = System.Convert.ToBase64String(hashmessage);
                string token = String.Format("{0}.{1}.{2}.{3}.{4}", apiKey, meetingNumber, ts, role, msgHash);
                var tokenBytes = System.Text.Encoding.UTF8.GetBytes(token);
                return System.Convert.ToBase64String(tokenBytes).TrimEnd(padding);
            }
        }

```

**Error**  
Not able to Join As host.

**Which Web Client SDK version?**  
1.9.0

**Device (please complete the following information):**

- Browser: [Chrome]
- Browser Version -Version 90.0.4430.93 (Official Build) (64-bit)

**Additional context**  
When I do break points on the code it does not go inside the success handler of the join function.

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [May 6, 2021, 11:50pm UTC](https://devforum.zoom.us/t/not-able-to-join-the-meeting-as-host-in-web-sdk-1-9-0/49634/2 "2021-05-06T23:50:16Z")

</div>

Hey @akshay.rao,

Thank you for reaching out to the Zoom Developer Forum. When this happens, do you see any errors in the Web SDK? What about in the browser console?

If so, please share the errors you’re seeing here.

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [June 6, 2021, 9:50am UTC](https://devforum.zoom.us/t/not-able-to-join-the-meeting-as-host-in-web-sdk-1-9-0/49634/3 "2021-06-06T09:50:45Z")

</div>

Closed on June 6, 2021, 9:50am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
