Hello,
I want to retireve all the favorite marked documents of a user in sharepoint site. I am aware of the My Content Page which will list us all the documents, recent opened, shared and favorite.
My requirement is to get only the favorite documents marked of a user.
Thanks & Regards
Sigar DavePosted Jun 27, 2024, 11:40 AM
There are couple of ways to do this using PowerShell or Graph API.
Use PnP PowerShell to fetch favorite documents from SharePoint.
Replace yourtenant with your tenant name and the site name as well.
In this example script, I am considering the Documents library, you can check from the multiple document library by converting this code to a for look for all the document libraries in the site
Meena BishtPosted Nov 12, 2023, 11:03 PM
Hello Tuhin,
Thank you for your response. However the above end point does not list me the favorite marked documents of a sharepoint site.
My Requirement is to fetch all the favorite marked files and show it to the user. SharePoint has provided MyContent Page but this displays all the files and user need to click on favorite to see not something by default.
Thanks & Regards
Tuhin PaulPosted Nov 10, 2023, 3:19 PM
You need to use the SharePoint REST API,
Use the user's ID to fetch their favorite documents. You can get the user's ID using the following endpoint:
Replace with your SharePoint site URL, and '[email protected]' with the user's email address.