question

RatneshKumar-2280 avatar image
0 Votes"
RatneshKumar-2280 asked

Get list of all public groups using graph api

Hello,

I need a direct query to graph api to get list of all public groups present in O365.

I am trying using below query but its giving 400 Bad request as I cannot use visibility property with $filter.

https://graph.microsoft.com/v1.0/groups?&$filter=groupTypes/any(a:a eq 'unified')&visibility eq 'Public'


Please let me know if we have a direct way to get list of all public group

Regards,
Ratnesh

microsoft-graph-groups
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

michev avatar image
1 Vote"
michev answered

The visibility property is not supported for $filter, you can get the full list and then filter it client-side. And for the sake of completeness, this is not how you combine multiple filters, use the 'and' operator:

 https://graph.microsoft.com/beta/groups?&$filter=groupTypes/any(a:a eq 'unified') and visibility eq 'Public'

(still wont work in this case).

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.