Cannot perform http request in zoom app script

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 as instructed, then modify public/js/index.js to become

// 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:

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. 
            a(href=`/install`) Click Here
            |  to install your app in Zoom.

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

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

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

Tried.
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?

1 Like

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.