Requesting Access Token through Jquery AJAX

Hi following is my code through which i am using to try to get the access toke but i am getting error
"Access to XMLHttpRequest at ‘https://zoom.us/oauth/token’ from origin ‘https://zoomintegration20200625133511.azurewebsites.net’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.

AquiredCode.html?code=hupsBKg4H2_ILzNuuO2QhCiTOvJlmEXog:92 {readyState: 0, getResponseHeader: ƒ, getAllResponseHeaders: ƒ, setRequestHeader: ƒ, overrideMimeType: ƒ, …}
jquery.min.js:2 POST https://zoom.us/oauth/token net::ERR_FAILED’

(Document).ready(function () { var code = getUrlParameter('code'); if (code.length > 0 && code != undefined) { (’#codeheading’).text(code);
GetToken(code);
}

    });
    function GetToken(code) {
        var clientID = 'xxxxxxxxxxxxxx6Q';
        var clientSecret = 'xxxxxxxxxxxxxxxxxxxxUr0'; 
        $.ajax({
            type: 'POST',
            url: 'https://zoom.us/oauth/token',
            crossDomin: true,
            headers: {
                'Authorization': 'Basic ' + btoa(clientID +':'+ clientSecret)
            },
            data: {
                'grant_type': 'authorization_code',
                'code': code,
                'redirect_uri': '..../AquiredCode.html'
            },
            success: function (data) {
                $('#codeheading').text(JSON.stringify(data));
            },
            error: function (error) {
                console.log(error);
            }
        });
    }

Hey @umarzaman_1,

As our OAuth docs state, you cannot call the Zoom API from the client side. You can use server side code like Node.js to make calls to the Zoom API.

Thanks,
Tommy

Thanks for your reply Tommy. I was able to achieve it using RestSharp client in Webapi 2.0.