Search code examples
microsoft-graph-apionedrivesharepoint-online

How to get all editors of list Items at once Microsoft Graph


I am wondering if it is possible to get all the editor names of the items in a drive.

I need to get a list of drive items with their editor names.

I can get all the items with their informations in one time.

(https://graph.microsoft.com/v1.0/sites/siteId/lists/documents/items/)

And in another time, i can retrieve the editor of all versions of a document.

(https://graph.microsoft.com/v1.0/sites/siteId/lists/documents/items/itemId/versions?expand=fields($select=Editor))

But i fear that if i have a large list of document, it will be too long to call the version endpoint foreach document.

Is there a way to get it quickly or not ?


Solution

  • It is not possible to retrieve all editors of all items within a drive in a single API call. As you stated you can retrieve all editors of the latest version, but you would need to query each individual item's version history for all past editors of all items.

    While not foolproof, you could query the site for all users who have edit / contribute permissions on the site, but it will not be historical (i.e. an editor may no longer be listed on the site if they have been removed or left).