Hello!
Trying to call SharePoint Online REST API from Dynamics CRM Resource (js file).
This is the code:
function spOnLoad() {
var req = new XMLHttpRequest();
req.withCredentials = true;
req.open("GET", encodeURI("<sp url>/_api/lists/getbytitle('Documents')/items"), true);
req.setRequestHeader("Accept", "application/json;odata=verbose");
req.onreadystatechange = function () {
if (this.readyState == 4 /* complete */) {
debugger;
req.onreadystatechange = null;
}
};
req.send();
}
But every time I get 403 forbidden. When I check Fiddler I see that "FedAuth=" cookie provided.
Any suggestions?
*This post is locked for comments
I have the same question (0)