Freshworks named the only Challenger in 2021 Gartner® Magic Quadrant™ for ITSM tools. Access Report

Start a new topic

CORS Policy

Anyone know how to do an API get request from the iparams page?  I keep getting this error when trying to pull in the groups to a dropdown for mapping between two systems.

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.

Yes, i have added this to my headers.  It works from everywhere but the app.


1 Comment

This the code I am currently using:

    dataType: "json",
    type: "Get",
    beforeSend: function(request) {
        request.withCredentials = true;
        request.setRequestHeader("Authorization", "Basic " + btoa($("#fs_api_key").val() + ":X"));
        request.setRequestHeader("Access-Control-Allow-Origin", "*");
        request.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
    url: "https://" + $("#fs_subdomain").val() + "",
    success: function(data) {
      results = JSON.stringify(data.ticket_fields);
      groups = getProperty(results, "group", "choices");
        var select = $(dropdown).empty();
        $.each(groups, function(key, value) {
            select.append('<option value="'+ value +'">'+ key +'</option>');


Login or Signup to post a comment