Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/list/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
List 为什么无法使用REST API从Sharepoint 2013库文件夹获取文件_List_Rest_File_Sharepoint_Get - Fatal编程技术网

List 为什么无法使用REST API从Sharepoint 2013库文件夹获取文件

List 为什么无法使用REST API从Sharepoint 2013库文件夹获取文件,list,rest,file,sharepoint,get,List,Rest,File,Sharepoint,Get,我正在尝试使用RESTAPI从SharePoint库获取文件列表。 为此,我使用以下查询: https://[Site]/_api/web/GetFolderByServerRelativeUrl('[Folder]')?$expand=Files,Folders https://[Site]/_api/web/GetFolderByServerRelativeUrl('[Folder]')/Files SharePoint为我提供以下json: { "d": { "__meta

我正在尝试使用RESTAPI从SharePoint库获取文件列表。 为此,我使用以下查询:

https://[Site]/_api/web/GetFolderByServerRelativeUrl('[Folder]')?$expand=Files,Folders
https://[Site]/_api/web/GetFolderByServerRelativeUrl('[Folder]')/Files
SharePoint为我提供以下json:

{
  "d": {
    "__metadata": {
      "id": "https://[Site]/_api/Web/GetFolderByServerRelativeUrl('[Folder]')",
      "uri": "https://[Site]/_api/Web/GetFolderByServerRelativeUrl('[Folder]')",
      "type": "SP.Folder"
    },
    "Files": { "results": [] },
    "ListItemAllFields": { "__deferred": { "uri": "https://[Site]/_api/Web/GetFolderByServerRelativeUrl('[Folder]')/ListItemAllFields" } },
    "ParentFolder": { "__deferred": { "uri": "https://[Site]/_api/Web/GetFolderByServerRelativeUrl('[Folder]')/ParentFolder" } },
    "Properties": { "__deferred": { "uri": "https://[Site]/_api/Web/GetFolderByServerRelativeUrl('[Folder]')/Properties" } },
    "StorageMetrics": { "__deferred": { "uri": "https://[Site]/_api/Web/GetFolderByServerRelativeUrl('[Folder]')/StorageMetrics" } },
    "Folders": { "results": [] },
    "Exists": true,
    "IsWOPIEnabled": false,
    "ItemCount": 4,
    "Name": "TEST",
    "ProgID": null,
    "ServerRelativeUrl": "[Folder]",
    "TimeCreated": "2016-12-01T10:50:22Z",
    "TimeLastModified": "2016-12-21T10:14:43Z",
    "UniqueId": "144967f1-512f-4180-b4a8-be8d0bfe90d9",
    "WelcomePage": ""
  }
}
如您所见,此文件夹中有4项查看“ItemCount”属性,但“文件”字段和“文件夹”字段中均显示空结果

我知道这个文件夹中确实有4个文件,因为我可以使用RESTAPI查询使用的相同登录名和密码直接在网站上看到它们

我还尝试了以下查询:

https://[Site]/_api/web/GetFolderByServerRelativeUrl('[Folder]')?$expand=Files,Folders
https://[Site]/_api/web/GetFolderByServerRelativeUrl('[Folder]')/Files
答案是

{"d":{"results":[]}}
对于列出REST api中的文件和文件夹,是否有任何特殊的自动编辑功能或需要了解的内容?

请使用下面的api:

https://sites.sharepoint.com/sites/test/forms/_api/Web/GetFolderByServerRelativePath(decodedurl='/sites/site or subsite URL/name Document List/name of folder')/Files
如果JSON显示{d:{results:[]},则表示您选择的文件夹为空。

请使用下面的API:

https://sites.sharepoint.com/sites/test/forms/_api/Web/GetFolderByServerRelativePath(decodedurl='/sites/site or subsite URL/name Document List/name of folder')/Files

如果JSON显示{d:{results:[]}},则表示您选择的文件夹为空。

您好,我现在面临同样的问题。你是如何解决你的问题的?你好,我现在面临着同样的问题。你是怎么解决你的问题的?