Nov 07 2017 03:57 AM - edited Nov 07 2017 04:02 AM
I need to execute CrossDomain REST Request (AJAX) on Sharepoint REST API, and get content as result of this request. My script executed on Browser (Chrome) on wich I logged on Sharepoint.
CODE EXAMPLE
// Load the required SharePoint libraries
$(document).ready(function () {
$.ajax({
method: "GET",
headers: { "Accept": "application/json; odata=verbose" },
cache: false,
async:false,
url: "https://LINK_TO_SITE.sharepoint.com/_api/lists/getbytitle('Kunde')/items?$expand=Folder",
data: "",
contentType: "application/jsonp; charset=utf-8",
dataType: "jsonp",
processData: true,
crossDomain: true,
success: function (data, status, jqXHR) {
console.log(data);
},
error:function (data, status, jqXHR) {
console.log(data);
}
});
});
And Have this error
If change dataType: "jsonp" to dataType: "json", get next error
This Page I publishing on the Dynamics CRM site as WebResource
Maybe some of you have a decision?