按项目ID获取文件夹ID - REST [英] Get Folder ID by Item ID - REST
问题描述
亲爱的专家,
我有一个要求,我在FolderA中有一个ItemA 。我需要通过传递ItemA ID来捕获FolderA ID。
我必须在REST API中执行此操作。
我尝试使用Google搜索但是不能找不到任何好的资源。
请帮忙。
谢谢,
Pavan。
Take自定义列表作为示例:
通过以下端点获取项FileRef。
/ _ api / Web / Lists / getByTitle('lista')/ Items(8)?
select = FileRef
结果将是/Lists/ListA/TestFolder/8_.000
然后,通过
获取文件夹
/ _ api / web / getFolderByServerRelativeUrl('/ Lists / ListA / TestFolder')/ ListItemAllFields
您可以从返回值中获取id。
最好的问候,
利跨度>
Dear Experts,
I have a requirement where I have an ItemA in FolderA. I need to capture FolderA ID by passing ItemA ID.
This I have to do in REST API.
I have tried googling but couldn't find any good resource.
Please help.
Thanks,
Pavan.
Hi,
Take custom list as example:
Get item FileRef by below endpoint.
/_api/Web/Lists/getByTitle('lista')/Items(8)?
select=FileRefThe result would be /Lists/ListA/TestFolder/8_.000
Then, get the folder by
/_api/web/getFolderByServerRelativeUrl('/Lists/ListA/TestFolder')/ListItemAllFields
You could get the id from the return value.
Best Regards,
Lee
这篇关于按项目ID获取文件夹ID - REST的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!