This article will briefly walk you through how you can automate creating Microsoft 365 group connected yammer communities using Power automate
Following topics will be covered in detailed before creating Power Automate Flow, don’t miss out Yammering
- What is Microsoft 365 Group connected Yammer Community
- Yammer App Registration to fetch Yammer OAuth Token
- Yammer Rest API to create Yammer Community (Group)
- Creating Power Automate Flow to provision Yammer Community (Group)
Microsoft 365 Group connected Yammer Community
Yammer Communities which have Office 365 Connected Yammer Groups enabled are eligible as Microsoft 365 Group connected Yammer Community.
This means that whenever a Yammer Community will be created it will also create the community resources like SharePoint library, SharePoint Site, OneNote, and Planner as highlighted in the picture below.
Currently, Only Public and Private type of Yammer communities can be provisioned for the Microsoft 365 Group connected Yammer community.
Fig 1.1 – Microsoft 365 Connected Yammer Community Groups
Note
Verify if Office 365 Connected Yammer Groups is Enabled or not by following these steps.
- If you are a Global Administrator, Yammer Administrator or Yammer verified Admin then you can Navigate to Yammer Admin centre: https://www.yammer.com/{tenantname}.onmicrosoft.com/admin
- Once you are in the Yammer admin centre, Click on Security Settings
- In Security Settings, you will see Office 365 Connected Yammer Groups, the status should be Enabled as shown in the below picture
Fig 1.2 – Yammer admin centre – Security settings – Office 365 Connected Yammer Groups
Yammer App Registration to fetch Yammer OAuth Token
Navigate to this mentioned URL: https://www.yammer.com/client_applications
Click on Register New App as highlighted in the below picture.
Fig 1.3 – Register a new Yammer Application
Fill the App details like described below and as shown in fig 1.4,
- Application Name - App name for yammer which will appear,
- Organization - The name of your organization (tenant name),
- Support Email - Email address of the support team for your organization,
- Website - Your organization’s website URL,
- Redirect URI - Secured redirect URI, this is the URL which redirects the user once the authentication is completed
Agree to the terms of services by checking the box and click on Continue to register your yammer application.
Fig 1.4 – Yammer New app registration
Once the app is registered you will be able to fetch registered app details, Client ID, Client secret, Redirect URI and click on Generate token – this will fetch the token which you can use in your Yammer Rest API for Authorization which we will use in Power Automate HTTP trigger.
Make a note and save all the fetched values including generated token.
From my observations and usage, this generated token does not expire
Fig 1.5 – Yammer OAuth token generated for the registered yammer application
Note: If you wish to generate token using Azure AD App please refer to this documentation, https://techcommunity.microsoft.com/t5/yammer-blog/yammer-api-with-aad-tokens-postman-collection/ba-p/857923
Yammer Rest API to create Yammer Community Group
To create yammer community (group) which is Office 365 connected, we will be using the below mentioned yammer rest API
Create yammer community (group) we will use POST Request API URL:
https://www.yammer.com/api/v1/groups.json?name={YammerGroupName}&private=false&show_in_directory=true
{YammerGroupName} – Name of your Yammer Community Group
Private = false (i.e Public Group)
Private = true (i.e Private Group)
Creating Power Automate Flow to provision Yammer Community (Group)
It’s time to dig into Power Automate and structure all the pieces together.
Navigate to https://make.powerautomate.com/
Create an Instant Cloud Flow
Fig 1.6 – Instant Cloud Flow
Now add a recursive trigger: Here for demo purposes, I have used recursive trigger, you can have manual trigger or automated trigger based on your use case and purpose
Fig 1.7 – Recurrence trigger
Now let’s declare a variable which will hold the YammerGroupName value by using initialize variable connector as shown in Fig 1.8
Fig 1.8 – Yammer Group Name variable with value
Now it’s time to add HTTP Trigger, In this HTTP Trigger we will use the API described above in Step C.
As you will observe from below Fig 1.9, in the Request URL, add dynamically as shown in Fig 1.10
In the Request Headers, add content-type as application/json &
Authorization as Bearer Token (Token -> Generated token as shown in Fig 1.5 and Step B.)
Fig 1.9 – HTTP Trigger – Create Yammer Community Group Request URI
Fig 1.10 – Dynamically add variable value in the API Request (name = YammerGroupName variable)
Note
Authentication in HTTP Trigger is set to None as we already have registered yammer app and are authenticating using Token generated (Yammer OAuth token)
It’s time to save the PowerAutomate flow and run a quick test to see the provisioned Yammer Community
The test was successful 😊, and the Yammer Community was created with the Group name mentioned in the Initialize variable.
Fig 1.11 – Office 365 Group connected Yammer Community provisioned
From the above Fig 1.11, you should see the community resources, a SharePoint Site which will be created. All the files in this Yammer Community group will be stored in the SharePoint Library.
Also, if you search by this Community name in Microsoft 365 Admin Centre > Active Teams and Groups, you should be able to see the Group created for you as it was Office 365 Connected
Fig 1.12 – Yammer community Office 365 Group created at the backend
Note
Whenever a Yammer Community (Group) will be created it will add the creator/requestor as the Owner for this Yammer Community (Group)
This article covers the details about Yammer concepts and Create Yammer Community Rest API and using the same in Power Automate.
In the upcoming article we will look at how you can add Members to Yammer Community (Group) and adding Owner’s to the Yammer Community (Group) with some interesting concepts
Till then, Keep Learning! Keep Yammering!