# Where does the webviewId come from in drawWebView method?

**URL:** <https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357>\
**Category:** Zoom Apps\
**Created:** [June 29, 2022, 5:41am UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357 "2022-06-29T05:41:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vandalayindustries](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vandalayindustries/32/39002_2.png) [@vandalayindustries](https://devforum.zoom.us/u/vandalayindustries)\
**Post date:** [June 29, 2022, 5:41am UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/1 "2022-06-29T05:41:39Z")

</div>

The [Zoom Apps SDK](https://marketplace.zoom.us/docs/zoom-apps/js-sdk/reference) describes a `drawWebView` method, which contains a `webviewId` as follows:

```auto
zoomSdk.drawWebView({ webviewId: 'xxx' x: 'xxx', y: 'xxx', width: 'xxx', height: 'xxx', zIndex:'xxx'})

```

However, nowhere else in the documentation is a webview ID mentioned. How does one get the webview ID of the current app? Or is there some undocumented method to create a new webview?

Thanks for the clarification!

---

<div class="post-metadata">

**Author:** ![jonathan.chong](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonathan.chong/32/35998_2.png) [@jonathan.chong](https://devforum.zoom.us/u/jonathan.chong)\
**Post date:** [June 29, 2022, 2:12pm UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/2 "2022-06-29T14:12:57Z")

</div>

The webviewId is just any string that you can pick.

---

<div class="post-metadata">

**Author:** ![vandalayindustries](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vandalayindustries/32/39002_2.png) [@vandalayindustries](https://devforum.zoom.us/u/vandalayindustries)\
**Post date:** [June 29, 2022, 4:22pm UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/3 "2022-06-29T16:22:48Z")

</div>

Hi Jonathan, thanks for the quick reply.

When picking a random string for the `webviewId`, the `drawWebView` method returns `{message: success}`, but doesn’t seem to actually render anything.

How can the relevant ID for the App’s view be obtained so it can be rendered? Or, alternatively, how can a new webview + ID be created so it can actually be rendered using `drawWebView`?

Thanks again!

---

<div class="post-metadata">

**Author:** ![jonathan.chong](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonathan.chong/32/35998_2.png) [@jonathan.chong](https://devforum.zoom.us/u/jonathan.chong)\
**Post date:** [June 29, 2022, 4:32pm UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/4 "2022-06-29T16:32:45Z")

</div>

When activating Camera Mode by calling runRenderingContext(), the WebView will automatically be generated. Please make sure that it has fully loaded before calling drawWebView().

---

<div class="post-metadata">

**Author:** ![vandalayindustries](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vandalayindustries/32/39002_2.png) [@vandalayindustries](https://devforum.zoom.us/u/vandalayindustries)\
**Post date:** [June 29, 2022, 6:43pm UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/5 "2022-06-29T18:43:19Z")

</div>

Yes, `runRenderingContext()` is called first. It returns `{message: success}`.

Then calling `drawParticipant`, for example, will draw a participant on the rendering context as expected.  
However, calling `drawWebView` in the same way does nothing.

Here’s a more specific example: say I want to render a participant, and then render a webview on top of part of the context. I’d expect I could call `drawParticipant` and then `drawWebView` (with relevant dimensions and Z-index) to achieve this, but it does not seem to work.

---

<div class="post-metadata">

**Author:** ![jonathan.chong](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonathan.chong/32/35998_2.png) [@jonathan.chong](https://devforum.zoom.us/u/jonathan.chong)\
**Post date:** [June 29, 2022, 6:56pm UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/6 "2022-06-29T18:56:55Z")

</div>

Would it be possible if you could share your code for calling drawWebView()?

---

<div class="post-metadata">

**Author:** ![vandalayindustries](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vandalayindustries/32/39002_2.png) [@vandalayindustries](https://devforum.zoom.us/u/vandalayindustries)\
**Post date:** [June 29, 2022, 7:14pm UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/7 "2022-06-29T19:14:16Z")

</div>

Surely:

```auto
const draw_webview_options = {
        webviewId: "123", 
        x: "0px", 
        y: "0px", 
        width: "300px", 
        height: "300px", 
        zIndex: "2"
      };
let draw_webview_response = await zoomSdk.drawWebView(draw_webview_options);

```

---

<div class="post-metadata">

**Author:** ![jonathan.chong](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/jonathan.chong/32/35998_2.png) [@jonathan.chong](https://devforum.zoom.us/u/jonathan.chong)\
**Post date:** [June 29, 2022, 7:47pm UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/8 "2022-06-29T19:47:47Z")

</div>

Instead of using strings in the parameters for x, y, width, height and zIndex, can you try using just numbers?

const draw\_webview\_options = {  
webviewId: “123”,  
x: 0,  
y: 0,  
width: 300,  
height: 300,  
zIndex: 2  
};

---

<div class="post-metadata">

**Author:** ![vandalayindustries](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/vandalayindustries/32/39002_2.png) [@vandalayindustries](https://devforum.zoom.us/u/vandalayindustries)\
**Post date:** [June 29, 2022, 11:02pm UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/9 "2022-06-29T23:02:12Z")

</div>

Thanks Jonathan, that works.

You folks might want to update the documentation. Or better yet have all the draw methods accept a consistent variable type (or allow them to accept both strings and numbers).

Thanks!

---

<div class="post-metadata">

**Author:** ![Robert.Wallis](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/robert.wallis/32/38438_2.png) [@Robert.Wallis](https://devforum.zoom.us/u/Robert.Wallis)\
**Post date:** [June 30, 2022, 2:10am UTC](https://devforum.zoom.us/t/where-does-the-webviewid-come-from-in-drawwebview-method/71357/10 "2022-06-30T02:10:46Z")

</div>

Thank you for finding this bug. We are updating the docs to use numbers instead of strings. 💙
