Using Yammer REST API with the New Yammer
Published Sep 01 2020 10:34 AM 19.2K Views
Microsoft

Yammer is revolutionizing its platform, incorporating a deeper integration with Microsoft 365, a redesigned UX, and improved, streamlined services. In order to offer customers these new features, Yammer has changed the format of the IDs that we use for communities, users, threads, and topics. This change corresponds to a shift on our backend from a REST API structure to a GraphQL structure. The old Yammer IDs are numeric (i.e. 123456), while the new IDs are a base64 encoded JSON (i.e. eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxMjM0NTYifQ).

 

It's important that as we transition to the new Yammer, we maintain compatibility with our v1 API structure. Many of our customers depend on our v1 APIs for a myriad of business workflows and their end users rely on our v1 APIs to request specific actions from an admin, including posting announcements in specific communities or posting on behalf of executives (coming soon). Microsoft Power Automate also requires old Yammer IDs.

 

Our customers have informed us that their workflows break when they try to use new Yammer IDs in our v1 APIs. We have received feedback that some of our customers have developed scripts to base64 decode the new Yammer IDs themselves, while others have resorted to third-party services to attempt to extract the old Yammer ID before calling our v1 APIs.

 

We are making this change because we strive to offer the highest quality service to our customers, and believe the burden should not fall on our customers to convert between the old and new Yammer IDs. We aim to facilitate a seamless transition to the new Yammer platform.

 

In response to customer feedback, we’re very excited to announce that we’ve updated several popular v1 API endpoints to support the use of new Yammer IDs! Now, customers can use the old or the new Yammer ID and get the exact same response. See below for an example and a list of supported endpoints.

 

For instance, if you enter either the old numeric group ID (i.e. 47513632) or the corresponding new ID (i.e. eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI0NzUxMzYzMiJ9), you receive the same JSON payload.

 

These URLs are interchangeable:
https://www.yammer.com/api/v1/users/in_group/47513632.json
https://www.yammer.com/api/v1/users/in_group/eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI0NzUxMzYzMiJ9.json

 

 

 

Supported Endpoints

GET /groups/[:id]
PUT /groups/[:id]
DELETE /groups/[:id]
GET /groups/for_user/[:id]
GET /groups/[:id]/members
GET /users/[:id]
PUT /users/[:id]
DELETE /users/[:id]
GET /users/liked_message/[:message_id]
GET

/users/in_group/[:group_id]

GET

/messages/in_thread/[:thread_id]

GET /messages/in_group/[:group_id]

 

These endpoints are available today for a number of preview customers. You can find the Yammer APIs here.

 

Kindly contact us if you would like to join the preview group. We welcome your feedback. Please feel free to drop us a note here or email us at api@yammer.com.

13 Comments

I am so excited for customers to preview this! Great work team!

Microsoft

Nice work team! Looking forward to seeing what developers do with this new functionality!

Brass Contributor

"Yammer is revolutionizing its platform" but is Yammer also considering upgrading its API which is quite old and not really nice to use ? Are you actively considering integrating a Yammer API to Microsoft Graph API (all other Microsoft 365 services are in Graph API) ? You are mentionning a Graph QL backend, is there a public Graph QL API available to query ?  Thanks in advance for yours answers @JessicaFrank .

Brass Contributor

Any plan to include the encoded IDs in the responses?

Microsoft

@Maja Sehovac Not at the moment because the way we encode the IDs may change in future updates.

Brass Contributor

You really should let us use the graphql API or update the v1 into something usefull (for example the Microsoft Graph), we need a good api :)

It's also very confusing when you say "Supported endpoints" when for example "/groups/[:id]" isn't in the official API-specification https://developer.yammer.com/docs/messagesmy_feedjson . Is this endpoint now supported or not? Its very frustrating that so many basic endpoints are undocumented.

 

Is there a way to find the ID of the associated Microsoft Group using the V1-api? We know that you (but not we) can do it using the graphql API and that its a quite important function to build any kind of integrated experience. 
If we know the SharePoint url or Microsoft Group Id we need to have a API to find the associated Yammer group id and also vice versa

 

We also need application permissions. If the API was stronger I think we would see more innovation and usage out there, today its hard to get anyone interested in building anything due to the struggle involved

Brass Contributor

Good to see that the Yammer v1 API endpoints support the use of new Yammer IDs to not break existing apps.

It would be even nicer to be able to use the Microsoft Graph API (with more functionality) for Yammer. When could this happen?

Thx, @JessicaFrank

almost all Microsoft 365 services use the Microsoft Graph API. What are the future plans here from the Yammer Team?

Microsoft

Thank you all for the feedback. We're looking into Graph API and supporting Application Permissions in Azure Active Directory, I don't have a timeline to share right now, but you'll be the first to know soon as we're ready.

 

 

Copper Contributor

It was mentioned in the article about decoding the new ID's.  Does anyone have a PowerShell example of how to do this? 

 

Using the example ID from the article, I thought it would be as simple as:

$example = "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxMjM0NTYifQ"

 [System.Text.Encoding]::Unicode.GetString([System.Convert]::FromBase64String($example)) 

Copper Contributor

For my comment above, I realized it's UTF8, not Unicode.  So the PS code should be:

 [System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String($example)) 

 

Copper Contributor

Is it possible to pull back Yammer Insights through this RESTful API or is there another Yammer insights API?

Deleted
Not applicable

I am happy to see the Yammer REST API being updated.
Will the API be extended in the future?
I look forward to expanded support for new features such as storylines.

Version history
Last update:
‎Sep 01 2020 10:56 AM
Updated by: