cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MWAN
Helper I
Helper I

API to get ID of all items in a document set

My requirement is to get the ID of all the file items in a document set.

Used GetFolderByServerRelativeUrl api,  https://xxx.sharepoint.com/sites/dev/_api/web/GetFolderByServerRelativeUrl('DocumentRequest/testing%... , I can get all the files in this document request but ID property is not available. 

 

Get files (properties) only action can get the ID property of the document set and all files. What is the API endpoint it uses? 

I can't find it in the response. 

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for checking. 

 

https://{site_url}/_api/web/GetFileByServerRelativeUrl('/Folder Name/{file_name})/$value actually download the file. 

 

I did a little trial and error, I can use this API to get the item id of the attachment, an item itself. With the ID, I am able to update other properties.

 

https://{site_url}/_api/web/GetFileByServerRelativeUrl('/Folder Name/{file_name})/ListItemAllFields return all properties, while 

https://{site_url}/_api/web/GetFileByServerRelativeUrl('/Folder Name/{file_name})/ListItemAllFields?$select=ID,Title, just like the filter query/. 

View solution in original post

2 REPLIES 2
abm
Super User III
Super User III

Hi @MWAN 

 

Not sure what's the endpoint it uses in Get File Properties but according to the documentation  API end point is GetFileByServerRelativeUrl.

 

GET https://{site_url}/_api/web/GetFileByServerRelativeUrl('/Folder Name/{file_name})/$value

 

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

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials

Thanks for checking. 

 

https://{site_url}/_api/web/GetFileByServerRelativeUrl('/Folder Name/{file_name})/$value actually download the file. 

 

I did a little trial and error, I can use this API to get the item id of the attachment, an item itself. With the ID, I am able to update other properties.

 

https://{site_url}/_api/web/GetFileByServerRelativeUrl('/Folder Name/{file_name})/ListItemAllFields return all properties, while 

https://{site_url}/_api/web/GetFileByServerRelativeUrl('/Folder Name/{file_name})/ListItemAllFields?$select=ID,Title, just like the filter query/. 

View solution in original post

Helpful resources

Announcements
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,683)