# Unexpected behavior with zoomSdk.openUrl

**URL:** <https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602>\
**Category:** Zoom Apps\
**Created:** [July 21, 2022, 5:08am UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602 "2022-07-21T05:08:43Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![gibron](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gibron/32/37298_2.png) [@gibron](https://devforum.zoom.us/u/gibron)\
**Post date:** [July 21, 2022, 5:08am UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/1 "2022-07-21T05:08:43Z")

</div>

**Problem:**  
`zoomSdk.openUrl()` is not behaving as expected.  
`openUrl()` returns `{message: "success"}` but nothing happens, the system browser is not invoked.

The docs [[1](https://marketplace.zoom.us/docs/beta-docs/zoom-apps/js-sdk/apis/#openurlurloptions)][[2](https://appssdk.zoom.us/classes/ZoomSdk.ZoomSdk-1.html#openUrl)] state it _Opens a URL in the system browser of a user’s device._

What is the correct way to call this API so that behavior can happen?

**Context:**  
I have ensured that:

- `openUrl` is in the config eg. `config({ capabilities: ['openUrl', ...],})`
- the url being called is whitelisted in the App
- Included in `package.json` like such: `dependencies": { ... "@zoom/appssdk": "^0.16.2", ... }`

**Example** of how it is used in current code:

```auto
const externalUrl = async () => {
window.zoomSdk.openUrl({url: 'https://example.com/',}).then((result) => {
      console.log('openUrl response:', result)
    })

```

**Related Docs** - I have reviewed the following docs:  
[1] [https://marketplace.zoom.us/docs/beta-docs/zoom-apps/js-sdk/apis/#openurlurloptions](https://marketplace.zoom.us/docs/beta-docs/zoom-apps/js-sdk/apis/#openurlurloptions)  
[2] [ZoomSdk | @zoom/appssdk - v0.16.2](https://appssdk.zoom.us/classes/ZoomSdk.ZoomSdk-1.html#openUrl)  
[3] [zoomapps-advancedsample-react/backend/api/thirdpartyauth at main · zoom/zoomapps-advancedsample-react · GitHub](https://github.com/zoom/zoomapps-advancedsample-react/tree/main/backend/api/thirdpartyauth)

Thanks!

---

<div class="post-metadata">

**Author:** ![narmadaravali](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/narmadaravali/32/39496_2.png) [@narmadaravali](https://devforum.zoom.us/u/narmadaravali)\
**Post date:** [July 21, 2022, 5:32pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/2 "2022-07-21T17:32:48Z")

</div>

Can you please confirm if you are adding domain of the URL to the `Domain allow list` in marketplace (where you configured your app) ?

For example, if I wanted to open `google.com` using `openUrl`, I would add it like this

 ![Screen Shot 2022-07-21 at 10.29.01 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/e/9/e95ebfd2771cba0e92235ae182f0ca1d1384d9ea.png)

---

<div class="post-metadata">

**Author:** ![gibron](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gibron/32/37298_2.png) [@gibron](https://devforum.zoom.us/u/gibron)\
**Post date:** [July 21, 2022, 5:49pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/3 "2022-07-21T17:49:54Z")

</div>

Hi @narmadaravali 👋

Yes; it is added to Domain allow list (both with and without `www.`).

And incase it was a curiosity, I also regenerated the publishable URL and re-installed the app after updating the Domain allow list.

---

<div class="post-metadata">

**Author:** ![narmadaravali](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/narmadaravali/32/39496_2.png) [@narmadaravali](https://devforum.zoom.us/u/narmadaravali)\
**Post date:** [July 21, 2022, 8:02pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/4 "2022-07-21T20:02:29Z")

</div>

The below code works

```auto
const externalUrl = async () => {
        window.zoomSdk
          .openUrl({ url: "https://www.google.com/" })
          .then((result) => {
            console.log("openUrl response:", result);
          });
      };

 externalUrl();

```

In the code you pasted, you are assigning an asynchronous function to a variable but not calling it. `externalUrl();`

---

<div class="post-metadata">

**Author:** ![gibron](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gibron/32/37298_2.png) [@gibron](https://devforum.zoom.us/u/gibron)\
**Post date:** [July 22, 2022, 11:59pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/5 "2022-07-22T23:59:42Z")

</div>

@narmadaravali, thanks, I am calling it. I just didnt show the calling code as I thought it was implied. But the calling code looks like this:

```auto
<a className="font-weight-bold ml-1" onClick={externalUrl} > Example Text </a>

```

Are there any other conditions that need to be true for this to work?  
And in your case did it successfully open system browser with `https://www.google.com/` ? Or was success the console log? B/c it is successfully logging to console but not opening system browser on my end.

---

<div class="post-metadata">

**Author:** ![narmadaravali](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/narmadaravali/32/39496_2.png) [@narmadaravali](https://devforum.zoom.us/u/narmadaravali)\
**Post date:** [July 23, 2022, 12:33am UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/6 "2022-07-23T00:33:55Z")

</div>

Yes, it opened `google.com` in my browser. Do you see any CSP blocking errors in console?

---

<div class="post-metadata">

**Author:** ![gibron](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gibron/32/37298_2.png) [@gibron](https://devforum.zoom.us/u/gibron)\
**Post date:** [July 25, 2022, 9:18pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/7 "2022-07-25T21:18:10Z")

</div>

There are no CSP errors in console just the console logs from the `externalURL` function. I am having trouble uploading screenshots to the forum right now but console just has:

```auto
[Log] Made it into externalUrl
[Log] ZoomSDK Footer: – Proxy {_version: "0.16.2", _postMessage: function, _clientVersion: "5.10.4.6592", …} 
[Log] openUrl response: – {message: "success"}

```

Which is a print of the sdk object from inside of `externalUrl` and that it was able to call `.openUrl` and got response `{message: "success"}` but still not experiencing the browser window open.

---

<div class="post-metadata">

**Author:** ![narmadaravali](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/narmadaravali/32/39496_2.png) [@narmadaravali](https://devforum.zoom.us/u/narmadaravali)\
**Post date:** [July 25, 2022, 10:27pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/8 "2022-07-25T22:27:46Z")

</div>

Can you please update your client version to latest (5.11.3) and see if it’s still happening. I am trying to identify the cause here.

---

<div class="post-metadata">

**Author:** ![gibron](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gibron/32/37298_2.png) [@gibron](https://devforum.zoom.us/u/gibron)\
**Post date:** [July 26, 2022, 12:35am UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/9 "2022-07-26T00:35:48Z")

</div>

Okay, updated from Client Version: 5.10.4 (6592) to Client Version: 5.11.3 (9065)  
The behavior is still the same, no system browser invoked.

---

<div class="post-metadata">

**Author:** ![narmadaravali](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/narmadaravali/32/39496_2.png) [@narmadaravali](https://devforum.zoom.us/u/narmadaravali)\
**Post date:** [July 26, 2022, 5:13pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/10 "2022-07-26T17:13:15Z")

</div>

Can you please do below steps in order and let me know your status?

1. After adding URL domain to allow list in marketplace, Generate publishable URL and reinstall the app.
2. Make sure `zoomSdk.config` response object doesn’t have “openUrl” in “unsupportedApis” list.

`zoomSdk.config` response object looks like this

```auto
{
   "clientVersion": "5.11.1.8356",
   "browserVersion": "applewebkit/17613.2.7.1.8",
   "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)",
   "auth": {
       "status": "authorized",
       "upgradable": true
    },
   "unsupportedApis": [],
   "runningContext": "inMainClient"
}

```

---

<div class="post-metadata">

**Author:** ![gibron](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gibron/32/37298_2.png) [@gibron](https://devforum.zoom.us/u/gibron)\
**Post date:** [July 27, 2022, 8:05pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/11 "2022-07-27T20:05:49Z")

</div>

Looking a the response object for `zoomSdk.config` seems to have exposed a core issue:

```auto
auth: {status: "authorized", upgradable: true}
browserVersion: "applewebkit/17612.1.29.5"
clientVersion: "5.11.3.9065"
product: "desktop"
runningContext: "inMainClient"
unsupportedApis: ["getMeetingContext", "openUrl"] 
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko)"

```

I am going to attempt re-generating URL after re-adding this to ZoomSDK API features.  
I could have sworn I did this first…

---

<div class="post-metadata">

**Author:** ![gibron](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gibron/32/37298_2.png) [@gibron](https://devforum.zoom.us/u/gibron)\
**Post date:** [July 27, 2022, 8:10pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/12 "2022-07-27T20:10:53Z")

</div>

The issue was that OpenUrl was not selected in ZoomSDK API features.  
Looking at the response from zoomSdk.config was very helpful!

Thank you @narmadaravali 🙏

---

<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:** [August 3, 2022, 8:17pm UTC](https://devforum.zoom.us/t/unexpected-behavior-with-zoomsdk-openurl/72602/13 "2022-08-03T20:17:45Z")

</div>

Closed on August 3, 2022, 8:17pm UTC


