# Cannot perform http request in zoom app script

**URL:** <https://devforum.zoom.us/t/cannot-perform-http-request-in-zoom-app-script/121514>\
**Category:** Zoom Apps\
**Created:** [November 26, 2024, 2:44am UTC](https://devforum.zoom.us/t/cannot-perform-http-request-in-zoom-app-script/121514 "2024-11-26T02:44:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidzhangshs](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/davidzhangshs/32/51460_2.png) [@davidzhangshs](https://devforum.zoom.us/u/davidzhangshs)\
**Post date:** [November 26, 2024, 2:44am UTC](https://devforum.zoom.us/t/cannot-perform-http-request-in-zoom-app-script/121514/1 "2024-11-26T02:44:21Z")

</div>

tested both locally and on ec2  
tested using fetch and using axios  
tested using dummy REST testing url, as well as AWS api gateway endpoint  
tested using both the simple and the advanced sample for zoom app

result in the same type of error: Fetch Error: Failed to fetch  
For axios it is some corresponding

To reproduce, setup [simple sample app](https://github.com/zoom/zoomapps-sample-js) as instructed, then modify public/js/index.js to become

```javascript
// import App from './App';

(async () => {
    try {
        const configResponse = await zoomSdk.config({
            size: { width: 480, height: 360 },
            capabilities: [
                /* Add Capabilities Here */
                'shareApp',
            ],
        });

        console.debug('Zoom JS SDK Configuration', configResponse);
    } catch (e) {
        console.error(e);
        const errorDiv = document.getElementById('fetchError');
        if (errorDiv) {
            errorDiv.textContent = `Configuration Error: ${e.message}`;
        }
    }

    // test fetch
    try {
        // load face image from local file
        const faceImage = new File([], 'face.jpg', { type: 'image/jpeg' });
        const response = await fetch('https://v8c6qwk16b.execute-api.us-east-1.amazonaws.com/default/RetrieveUserByFace', {
            method: 'POST',
            body: faceImage,
        });
        
        const responseData = await response.json();
        console.log(responseData);
        
        const responseDiv = document.getElementById('fetchResponse');
        if (responseDiv) {
            responseDiv.textContent = JSON.stringify(responseData, null, 2);
        }
    } catch (error) {
        console.error('Fetch error:', error);
        const errorDiv = document.getElementById('fetchError');
        if (errorDiv) {
            errorDiv.textContent = `Fetch Error: ${error.message}`;
        }
    }
})();

```

also modify server\views\index.pug:

```pug
extends layout

block content
    h1=title
    if isZoom
        p Welcome to your Zoom App
        #fetchResponse.response-container
        #fetchError.error-container
    else
        p You're viewing your Zoom App through the browser.&nbsp;
            a(href=`/install`) Click Here
            | &nbsp;to install your app in Zoom.

append scripts
    if isZoom
        script(type="module" src='/js/bundle.mjs')
        script(nomodule src='/js/bundle.js')

```

---

<div class="post-metadata">

**Author:** ![Fario\_Consulting](https://avatars.discourse-cdn.com/v4/letter/f/5daacb/32.png) [@Fario\_Consulting](https://devforum.zoom.us/u/Fario_Consulting)\
**Post date:** [November 26, 2024, 11:37am UTC](https://devforum.zoom.us/t/cannot-perform-http-request-in-zoom-app-script/121514/2 "2024-11-26T11:37:06Z")

</div>

Hi,

One workaround would be move your API calls for integrating the Zoom WEB SDK onto your backend server instead of making them directly from your client-side code. As such, you would avoid request issues that can lead to HTTP status errors when trying to hit the Zoom endpoints

Cheers,  
Harsh

---

<div class="post-metadata">

**Author:** ![MultiplayerSession](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/multiplayersession/32/66446_2.png) [@MultiplayerSession](https://devforum.zoom.us/u/MultiplayerSession)\
**Post date:** [November 26, 2024, 2:40pm UTC](https://devforum.zoom.us/t/cannot-perform-http-request-in-zoom-app-script/121514/3 "2024-11-26T14:40:44Z")

</div>

Have you disclosed and justified the domains used by your endpoints in your application settings under **Build your app** ; **Features** ; **Surface** ; **Domain Allow List**?

---

<div class="post-metadata">

**Author:** ![davidzhangshs](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/davidzhangshs/32/51460_2.png) [@davidzhangshs](https://devforum.zoom.us/u/davidzhangshs)\
**Post date:** [November 26, 2024, 5:48pm UTC](https://devforum.zoom.us/t/cannot-perform-http-request-in-zoom-app-script/121514/4 "2024-11-26T17:48:49Z")

</div>

Tried.  
[v8c6qwk16b.execute-api.us-east-1.amazonaws.com](http://v8c6qwk16b.execute-api.us-east-1.amazonaws.com)  
Is in the domain allowed list but doesn’t help. Am I adding it the wrong way?

---

<div class="post-metadata">

**Author:** ![davidzhangshs](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/davidzhangshs/32/51460_2.png) [@davidzhangshs](https://devforum.zoom.us/u/davidzhangshs)\
**Post date:** [November 26, 2024, 6:09pm UTC](https://devforum.zoom.us/t/cannot-perform-http-request-in-zoom-app-script/121514/5 "2024-11-26T18:09:44Z")

</div>

good idea. will try. Thanks

correction; we are using aws lambda + aws api gateway for serverless backend. don’t have additional backend. This is already a request directly to backend.
