Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Call SharePoint REST API from Dynamics CRM Online

$
0
0

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? 


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images