How to fetch data from an API using Ajax? [duplicate]

I have an ajax function here :

EventManager.GetLeaveBalance = function (idemployee) {
    $.ajax({
        url: "http://xxx.xxx.xxx:83/GetLeaveBalance/" + idemployee,
        type: "GET",
        dataType: "json",
        contentType: "application/json",
        success: function (data) {
           
            console.log(data);
        }
    });
}

somehow If I call it on console it shows error :

EventManager.GetLeaveBalance(2170)
undefined
EventManager:1 Access to XMLHttpRequest at 'http://xxxx.xxxx.xxxx:83/GetLeaveBalance/2170' from origin 'http://localhost:51130' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
jquery.min.js:4          
GET http://xxxx.xxxx.xxxx:83/GetLeaveBalance/2170 net::ERR_FAILED

can someone help me ? I’m new to API.