2

I have an Asset Library with document sets, that I need to pull data from. I'm able to pull data from using the following code, but not sure how to get and enumerate data from the associated document set.

//gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/items
//gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/items(1)

<script type="text/javascript">
    $.ajax({
        url: "https://gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/items(1)/Additional Content",
        type: "GET",
        headers: {"Accept": "application/json;odata=verbose"},
        cache:false,                
        success: function(data){
            console.log(data);
            var html = "<table border='0'>";
            $(data.d.results).each(function(){
                html = html + "<tr><td>" + this.Title + "</td></tr>" +
    "<tr><td><h2>" + "Roles           :" + "   " + this.Roles + "</h2></td></tr>";
            });
            html += "</table>";
            $("#listResult").html(html)
        }
    });
    </script>

    <div id="listResult"></div>

1 Answer 1

2

Document Set you can treat as a Folder in the Document Library.

Hence for listing those you should use the Files EndPoint. Something like

https://gumdropsgc.sharepoint.com/sites/Training/_api/web/lists/getbytitle('Modules')/Files

The above query will give you all Files in that Library. For targeting a particular folder you can use Children.

More on accessing Files using REST API https://msdn.microsoft.com/en-us/office/office365/api/files-rest-operations

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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