0

I am using SharePoint account like in screenshot heresharepoint layout

I am trying to get folder via SharePoint REST API but I am unable to pass access_token because I dont know how to fetch access_token from sharepoint API.

Refer:

https://msdn.microsoft.com/en-us/library/office/dn292553.aspx

-1

Have you even tried to make a GET request?

You don't need to give access token for "GET" requests, for example:

    var url = "/_api/web/lists/getbytitle('Folder Name')/items";

    $.ajax({
        url: _spPageContextInfo.webAbsoluteUrl + url,
        type: "GET",
        headers: {
            "accept": "application/json;odata=verbose",
        },
        success: function (data) {
             console.log(data);
        },
        error: function (error) {
            console.log(error.responseJSON.error.innererror.message);
        }
    });

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.