Connect to Yammer REST API using PowerShell
How to connect to Yammer REST API using PowerShell. Register an App with Yammer, generate a developer token, connect to REST API and get a list of Yammer groups.

Getting started with Yammer REST API and PowerShell - TechLabs
1. Register an App with Yammer
https://www.yammer.com/client_applications
Click here to register a new app
Application Name: Yammer-PowerShell
Organization: Your Organisation
Support email: admin@yourdomain.com
Website: https://www.yourdomain.com
Redirect URI: https://www.yourdomain.com
Tick: Agree to Yammer API Terms of Service
2. Generate a developer token
Copy the developer token and save it in your password manager.
3. Connect to Yammer REST API - Groups
Now let's use PowerShell to connect to REST API and get a list of Yammer groups
$token = "12345678912-AbcdE1FGh23t4ijKLMnoP" $url = "https://www.yammer.com/api/v1/groups.json" $headers = @{ "Authorization" = "Bearer "+$token } Invoke-WebRequest -Uri $url -Method Get -Headers $Headers
Reference:
by Author
Register An App With Yammer
https://learn.microsoft.com/en-us/rest/api/yammer/app-registration
Yammer REST API endpoints
https://learn.microsoft.com/en-us/rest/api/yammer/rest-api-rate-limits
Comments 2
Hi there,
I am able to get the groups fine. But get 400 error when I try to suspend a user using the following:
$token = "***********************"
$url = "https://www.yammer.com/api/v1/users/357099000000.json"
$headers = @{ "Authorization" = "Bearer "+$token }
Invoke-WebRequest -Uri $url -Method Delete -Headers $Headers
Would you be able to provide advise on why this is?
Thanks in advance
Hi, there are some more guides for Yammer API here:
Getting started with Yammer REST API and PowerShell
https://techlabs.blog/categories/office-365/getting-started-with-yammer-rest-api-and-powershell
Take a look at "Delete Yammer users with REST API PowerShell" it has step by step instructions and some info about the "remote server returned an error 400 Bad Request" error. You'll need to become a member to access the guide
Hope that helps!