We have an Office 365 portal and our client wanted to have a Yammer Like button. Alright, that’s easy! Add the Yammer Embed Like and we are done.
The client came back and said: Ah that looks good, but could you also please add the number of likes?
And there is where this blog post is about: Because it’s impossible to get the number of likes, created by the Yammer Like Embed. I have implemented a solution, without a custom database, and is working like a charm. It takes some time though…
We had the requirement to embed a Yammer poll in SharePoint. This poll would be shown on the homepage of an Office 365 portal. With the Yammer WebPart deprecated, there are two options: Use the REST API, or use the Yammer Embed. We initially tried it with the Yammer Embed, but that is too limited. It only allows to display a certain feed, and has no filter options. The only way to show only one item is to use a Topic feed, and only tag one poll with that Topic. Another showstopper was that we could not apply our styling to the Yammer embed, as it’s hosted in an iframe with no options to style it. It was also annoying that the user had to log in / authenticate every time the browser was closed & reopened.
On the other hand, the REST API has no official documentation around polls. It is possible to retrieve the poll(s), but officially it’s not possible to submit votes. However, I found a solution with the REST API and impersonation with a server-side stored token. This would mean that a user would not have to log in, it would always work.
There are three steps:
- Create a Yammer App
- Retrieve a test access token as a Yammer Network Admin
- Create a SharePoint Provider Hosted add-in, in my case I’ve chosen for MVC.