Hi,
There is REST API, from which I am trying to fetch response.
Issue is if I use JSONP to overcome cross-domain issue then I get error_code:1000 in console.
This is the response I get in console:
Object {header: Object, body: Object}
body:Object
error_code:1000
__proto__:Object
header:Object
__proto__:Object
This is my AJAX call looks like
$.ajax({
type: 'GET',
url: 'for security reason I cannot display API URL',
dataType: 'jsonp',
data: {
authtoken: AppFramework.constants.AUTHTOKEN
},
success: function(result) {
console.log(result) ;
}
});
};
Is this a whitelisting issue? I am unable to identify. Please suggest.
What I have tried:
When I use data type as JSON, it gives cross domain error.
I get below error.
XMLHttpRequest cannot load https://www.site24x7.com/api/reports/availability_summary?period=3&authtoken=2f8671565a3cbb9e44b858160355ad7c. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://127.0.0.1:59185' is therefore not allowed access.