Use HTTP API to Export Dashboards

I want to make a web page to allow the export of multiple dashboards. I want to use the HTTP API for this, but I always get this error message:

Access to XMLHttpRequest at ‘’ from origin ‘’ 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

And the code is:

const startExport = () => {
        let xhttp = new XMLHttpRequest();
        let jwtoken = 'eyJrIjoieFlCNk5vdmV3WkdqZWl4eThWUXh1RmdZanNFOTNieVUiLCJuIjoiZXhwb3J0LmltcG9ydCIsImlkIjoxfQ==';
        xhttp.onreadystatechange = () => {
            if (this.readyState == 4 && this.status == 200) {
                document.getElementById('resultExport').innerHTML = this.responseText;
        };"GET", "", true);
        xhttp.setRequestHeader('Content-Type', 'application/json');
        xhttp.setRequestHeader("Accept", "application/json");
        xhttp.setRequestHeader('Authorization', 'Bearer ' + jwtoken);

That is a first test to get all Dashboards from my Grafana instance.