Forum Discussion

kevincoulson's avatar
11 years ago

RestAPI Ajax using JQuery


I am trying to access the RestAPI using an ajax call but am coming up against issues. Is there any documentation for accessing it this way?

I am currently just trying the log in command but am getting this error: XMLHttpRequest cannot load No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

I know that this is an issue with CORS but I do not know how to resolve it as I can't find a way to allow CORS on the AlertSite service.

My js is as follows: 


    type: "POST",

    contentType: "text/xml",

    data&colon; "<Login><Login>[myUsername]</Login><Password>[myPassword]</Password></Login> ",

    dataType: "xml",

    crossDomain: true,

    error: function (jqXhr, textStatus, errorThrown) {



    success: function (data) {




Any help would be greatly appreciated.