Reputation: 1849
Last week, Microsoft released the new Graph API to the public (after being in preview for a few months) exposing Office365 data via REST. As everything is still relatively new, there are only few tutorials & documentation available.
I am looking for a way to get a list of all recently opened/edited files, much like e.g. the OneDrive app does & shows me. From the documentation, I know how to get files and the last change date. However, there is maybe a more efficient way to get the most recent files, rather than recursively iterate through every folder and have a look at the files.
Do you have any ideas?
There is also a request for files trending around me (https://graph.microsoft.com/beta/me/trendingAround
), but the results are just some public files, also shown on Delve.
Upvotes: 2
Views: 2543
Reputation: 243
To do this in the graph, you would use:
/v1.0/me/drive/recent
Upvotes: 3
Reputation: 706
I'm not sure if it's possible using the Microsoft Graph but it's definitely possible using the SharePoint Search REST API by issuing the following request:
https://contoso.sharepoint.com/_api/search/query?querytext='isdocument:1'&sortlist='LastModifiedTime:descending'
Upvotes: 2