在根级别过滤sharepoint系统文件夹

时间:2015-07-07 23:04:28

标签: rest sharepoint

在线从Sharepoint检索REST时,有没有办法过滤系统文件夹?

从MSDN文档中使用http://xxxxx.sharepoint.com/_api/web/folders检索根级别的所有文件夹我找不到区分系统和自定义文件夹的方法。

我也尝试按文件夹属性进行过滤,但没有找到可能有帮助的属性。

作为一个例子,我得到这样的文件夹:

Exists = 1;
Files = {
      "__deferred" = {
            uri = "https://xxxxx.sharepoint.com/_api/Web/GetFolderByServerRelativeUrl('/SiteCollectionImages')/Files";
                    };
                };
Folders = {
      "__deferred" = {
            uri = "https://xxxxx.sharepoint.com/_api/Web/GetFolderByServerRelativeUrl('/SiteCollectionImages')/Folders";
                    };
                };
IsWOPIEnabled = 0;
ItemCount = 1;
ListItemAllFields = {
      "__deferred" = {
            uri = "https://xxxxxx.sharepoint.com/_api/Web/GetFolderByServerRelativeUrl('/SiteCollectionImages')/ListItemAllFields";
                    };
                };
Name = SiteCollectionImages;
ParentFolder = {
      "__deferred" = {
            uri = "https://xxxxx.sharepoint.com/_api/Web/GetFolderByServerRelativeUrl('/SiteCollectionImages')/ParentFolder";
                    };
                };
ProgID = "<null>";
Properties = {
      "__deferred" = {
            uri = "https://xxxxx.sharepoint.com/_api/Web/GetFolderByServerRelativeUrl('/SiteCollectionImages')/Properties";
                    };
                };
ServerRelativeUrl = "/SiteCollectionImages";
TimeCreated = "2014-04-25T12:54:44Z";
TimeLastModified = "2015-01-13T11:08:47Z";
UniqueId = "bffe7ef4-b242-4b13-990b-fcd00e7617af";
WelcomePage = "";
"__metadata" = {
         id = "https://xxxxxx.sharepoint.com/_api/Web/GetFolderByServerRelativeUrl('/SiteCollectionImages')";
         type = "SP.Folder";
         uri = "https://xxxxxx.sharepoint.com/_api/Web/GetFolderByServerRelativeUrl('/SiteCollectionImages')";
                };

1 个答案:

答案 0 :(得分:0)

我找到了答案。虽然它仍然不完美,因为它仍会显示一些系统文件夹,但它会过滤大部分文件夹。使用以下查询完成工作:

https://xxxxxx.sharepoint.com/_api/web/Lists?$filter=BaseTemplate+eq+101