在Sharepoint 2013(Odata)中通过guid访问文件夹

在Sharepoint 2013(Odata)中通过guid访问文件夹,sharepoint,odata,sharepoint-2013,Sharepoint,Odata,Sharepoint 2013,我正在尝试提取嵌入到Sharepoint API列表项中的视频。我拥有的数据示例如下: site=218a5f362d1241418a939d5c302507a0&web=425c1c9cf7e3406d9a0d2cc5f28ec9e0&folder=25abed4de9624c9ca264e39f3de7f747 我假设我可以通过提供的GUID访问该文件夹,但我看不出是否能够这样做?如何访问它所指向的文件?好吧,您必须处理每个Id才能获得关联对象 要访问web

我正在尝试提取嵌入到Sharepoint API列表项中的视频。我拥有的数据示例如下:

site=218a5f362d1241418a939d5c302507a0&web=425c1c9cf7e3406d9a0d2cc5f28ec9e0&folder=25abed4de9624c9ca264e39f3de7f747

我假设我可以通过提供的GUID访问该文件夹,但我看不出是否能够这样做?如何访问它所指向的文件?

好吧,您必须处理每个Id才能获得关联对象

要访问web,您可以使用:

/_api/web/webs?$filter=ID eq guid'**your_web_guid**'
现在,您有了web url。您可以获得您的列表:

your_web_url/_api/Web/Lists(guid'**your_list_guid**')
your_web_url/_api/web/lists/getbytitle('**your_list_title**')/items?$filter=startswith(ContentTypeId, '0x0120')
你得到了名单的标题。然后,您可以获得列表中所有文件夹的列表:

your_web_url/_api/Web/Lists(guid'**your_list_guid**')
your_web_url/_api/web/lists/getbytitle('**your_list_title**')/items?$filter=startswith(ContentTypeId, '0x0120')

在结果中搜索文件夹的guid,您的工作就完成了。

好吧,您必须处理每个Id才能获得关联对象

要访问web,您可以使用:

/_api/web/webs?$filter=ID eq guid'**your_web_guid**'
现在,您有了web url。您可以获得您的列表:

your_web_url/_api/Web/Lists(guid'**your_list_guid**')
your_web_url/_api/web/lists/getbytitle('**your_list_title**')/items?$filter=startswith(ContentTypeId, '0x0120')
你得到了名单的标题。然后,您可以获得列表中所有文件夹的列表:

your_web_url/_api/Web/Lists(guid'**your_list_guid**')
your_web_url/_api/web/lists/getbytitle('**your_list_title**')/items?$filter=startswith(ContentTypeId, '0x0120')

在结果中搜索文件夹的guid,您的工作就完成了。

如果web未直接卸载根目录,恐怕,
/\u api/web/webs?$filter=ID eq guid'**您的\u web\u guid**'
将无法工作。它将只返回直接子站点。您可能需要类似Site.AllWebs的内容,但据我所知,REST接口中未公开该属性。如果web未直接卸载根目录,恐怕,
/\u api/web/webs?$filter=ID eq guid'**您的\u web\u guid**'
将无法工作。它将只返回直接子站点。您可能需要类似Site.AllWebs的内容,但据我所知,该属性未在REST接口中公开。