<link href="https://fonts.googleapis.com/css?family=Roboto:100,100italic,200,200italic,300,300italic,400,400italic,500,500italic,600,600italic,700,700italic,800,800italic,900,900italic&amp;display=swap" rel="stylesheet"/>
1 minute reading time (264 words)

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

Yammer how-to guides: Connect to Yammer REST API using PowerShell. Get all Yammer groups using REST API and PowerShell. Get Yammer group members using REST API PowerShell. Delete Yammer groups and users with REST API PowerShell

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 

Related Posts

 

Comments 2

Guest - hello768 on Wednesday, 11 October 2023 11:47

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, 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
TechLabs on Friday, 13 October 2023 11:15

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!

Hi, there are some more guides for Yammer API here: Getting started with Yammer REST API and PowerShell [url=https://techlabs.blog/categories/office-365/getting-started-with-yammer-rest-api-and-powershell]https://techlabs.blog/categories/office-365/getting-started-with-yammer-rest-api-and-powershell[/url] 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!
Already Registered? Login Here
Sunday, 20 July 2025
You can help support this website by buying me a coffee!
Buy Me A Coffee