Sharepoint REST API:按 TimeLastModified 过滤 GetFolderByServerRelativeUrl

问题描述 投票:0回答:1

我尝试使用基于

GetFolderByServerRelativeUrl
或任何修改或创建日期的 Sharepoint API 来过滤对
TimeLastModified
的调用,但我无法成功。

https://mycompany.sharepoint.com/sites/myTeam/_api/web/GetFolderByServerRelativeUrl('/sites/MyTeam/Shared%20Documents/My%20Project')?$expand=Files&$filter=TimeLastModified ge datetime'2023-12-11T00:00:00Z' 和 TimeLastModified le 日期时间'2024-01-05T00:00:00Z'

我正在获取文件夹中的所有项目,而不是在请求日期创建或修改的项目。

该文档似乎已弃用:

https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-folders-and-files-with-rest

https://neganov.blogspot.com/2013/06/filtering-items-by-date-range-using.html

创建者的 SharePoint REST API 筛选器

https://sharepoint.stackexchange.com/questions/212487/filter-based-on-date-in-rest-query-to-get-item-from-sharepoint-list

https://support.shortpoint.com/support/solutions/articles/1000307202-shortpoint-rest-api-selecting-filtering-sorting-results-in-a-sharepoint-list

sharepoint sharepoint-api
1个回答
0
投票

将请求更改为以下内容应该可以解决您的问题:

https://mycompany.sharepoint.com/sites/myTeam/_api/web/GetFolderByServerRelativeUrl('/sites/MyTeam/Shared%20Documents/My%20Project')/Files?$filter=TimeLastModified ge datetime'2023- 12-11T00:00:00Z' 和 TimeLastModified 日期时间'2024-01-05T00:00:00Z'

© www.soinside.com 2019 - 2024. All rights reserved.