Extract list of Yammer Group ?

Contributor

Hey @Tom Kretzmer I also wrote a powershell script to do something ;)

 

Use case : The yammer Network Governance would like to make some house keeping and cleansing (because you have 1000 employees and 500 yammer group !), so they asked you to make a list of all yammer group to make that review. But there is a problem, you not have facilities to make this => no admin feature), the sole way you have could consist to make a Data Extract from Yammer Admin Interface/Console, but CSV fiel within the extract don't containg lot of KPI indicator to ease that arbitration.

 

But don't worry, you can use Yammer API, if you have 8 min in front of you, you can play that video (it will show you how to proceed MANUALLY, as you will notice it will take time ... even I speedup the video)

 

 

Now, you saw the video, it could be good to make something more automated. This method is more complicated but will help you to get a better list including a couple of group KPI indicator I consider very usefull (but missing from standard group export).

It is recommended to run the methods as Yammer Network Admin (to be able to list all the group), if you run this methods without being Yammer Network Admin you will be able to get a list of group but it will not include Groups Hidden from Yammer Group Directory.

Once you will completed action sequence describe bellow, you will be able to get a Yammer Group list containing the following information (you have a sample XLSX file in attachment)

 

  • id: this is the id you the yammer group (like 12344678)
  • email: the group email address
  • full-name: the group name
  • description: the group description
  • privacy: if the group is public|private
  • show_in_directory: if the group is display or hidden within yammer group directory
  • moderated: if the group is moderated by group admin true|false
  • web_url: the group url (direct link) when browsing with web browser
  • mugshot_xxx : the address of group thumbnail, it will help you to define if the group have a thumbnail or not (default value)
  • color: the yammer group banner HEW color like #417C9F, quite usefull if you need to enforce this from governance/corporate branding perspective
  • stats/members: the number of group members (very very usefull when you want to make some group house keeping or arbitration)
  • created_at: when the group was created
  • stats/last_message_at: when last message within that group was done

 

I also attach the powershell script in attachment + code below

 

#
# Name : getYammerGroup.ps1
# By : Eric JENOUVRIER
# Description : A tiny powershell script to extract yammer group as a csv file
#
# Typical usage : extract all the group you have within your yammer network as an excel spreadsheet
# + some KPI indicator to make some review at governance level and undertake some arbitration
# such Delete, Revitalize, Merge some Yammer Group.
#
# Important : For confidentiality reason, the $Token value was obfuscate.
# You need to replace the $Token value by your own private network value.
#
# Warning : never ever, share a script on which your secure token is in clear,
# else you give access to your private network ...
#

$Token = "5****-A********************Q"

$Headers = @{
"Authorization" = "Bearer "+$Token
}

$GroupCycle = 1
DO
{
$GetMoreGroupsUri = "https://www.yammer.com/api/v1/groups.json?page=$GroupCycle"
write-host ($GetMoreGroupsUri)
$MoreYammerGroups = (Invoke-WebRequest -Uri $GetMoreGroupsUri -Method Get -Headers $Headers).content | ConvertFrom-Json
$YammerGroups += $MoreYammerGroups
$GroupCycle ++
$GroupCount = $YammerGroups.Count
write-host ($GroupCount)
}
While ($MoreYammerGroups.Count -gt 0)

$YammerGroups | Export-Csv export.csv -Delimiter ";"

 

4 Replies

This is nice!  Much more elegant way to get around the 50-group limit than the one I cobbled together.  If you don't mind, I'll update my scripts to use this method.  :)

Feel free to reuse @Tom Kretzmer I am sharign there to allow the community to re-use :)

Hi   @Eric JENOUVRIER,

 

Thanks for sharing the information, I also want to use same API end point from Javascript(yammer JS-SDK) , when I am calling it it is throwing access origin error.  

 

https://www.yammer.com/api/v1/groups.json?mine=1

 All other APIs are hosted in api.yammer.com, but while I calling it, shown authorization error.

 

 

https://api.yammer.com/api/v1/groups.json?mine=1

 

 

Do you have any suggestion on it.

 

Thank you.

What is the mine=1 parameter?  

 

You have to instantiate your Yammer session first - easiest way is to browse to Yammer first and let it handle all the authentication, then just use that session and paste it in.  https://www.yammer.com/api/v1/groups.json is the right API for this one.