Forum Discussion
cdempsey-sonicules
Nov 30, 2023Copper Contributor
Best way to retrieve a list of all VE Communities via an API?
I am trying to retrieve the list of all VE Communities (Public and Private) in a network via an API.
Based on the documentation here About the Yammer REST API - Yammer | Microsoft Learn
I have used the exports endpoint Network Data Export - Yammer | Microsoft Learn
and I have found and been using an undocumented groups.json endpoint
https://www.yammer.com/api/v1/groups.json
What is the recommended way of achieving this goal via an API?
- You are correct! I was looking at an old script I had! So you've probably already solved this, but I'll post how to do it if anyone else get's stuck
So what you need to do is query group and then filter out creationOption, as you can't filter out only Yammer in a single query due to creationOption not being visable ๐
This will return all groups and their creationOption:
https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/any(a:a eq 'unified')&$select=id,displayName,creationOptions,resourceProvisioningOptions&$top=999
- As you probably have native mode enabled, you can just get all unified group and check if they're yammer/engage enabled
Get-UnifiedGroup -ResultSize Unlimited | Where-Object {$_.GroupSku -eq "Yammer"}- cdempsey-soniculesCopper ContributorHi NicolasKheirallah
Thanks for your response!
I wonder if there is any way to do this via the microsoft graph api directly rather than via PowerShell?
Sorry, I should have been more precise in my original post- https://graph.microsoft.com/v1.0/groups?$filter=groupTypes/any(g:g eq 'Unified') and resourceBehaviorOptions/any(r:r+eq+'YammerProvisioning')
Should do it