Friday, 24 November 2017

Graph API : Get all the Office 365 Groups Owned by a user

There is a Graph API endpoint to get all the Office 365 Groups a user is Member of. The filter is used to get only the Office 365 Groups.


I wanted to retrieve all the Groups that a user owns, however there is no "ownerOf" endpoint. The endpoint ownedObjects can be used to retrieve this data. 

For the current user :


For a specific user : 


However this endpoint returns all the directory objects the user is owner of.  When I tried to $filter on this endpoint, it did not work ! Through the Graph explorer it appears that at the time of writing this, $filter to this endpoint is not currently supported.  So you may just have to retrieve all the data that is returned and then filter on the "groupTypes" property of the group object in your application code.

No comments:

Post a Comment