How to Create Yammer Group Programmatically using C#

Sathish Nadarajan
 
Solution Architect
June 17, 2017
 
Rate this article
 
Views
4908

Nowadays, Yammer has become an integral part of Office 365 Sites. When we POST a data from our Site Collection, it gets stored in the Yammer.

When, we open the Context Menu of the File and Click on the POST, a Yammer Popup will be coming.

clip_image002

clip_image004

On the popup, we will be entering our text and click on POST. This will be reflected on the Yammer Site. There are many things, which we need to integrate with the Yammer. Let us focus them on the upcoming articles. But, Yammer and Office 365, has a tight coupling and there are lot more can be achieved, if we use them properly.

The Inserted comment can be visible on the Yammer site as below. But, if you could see, Yammer can be created with many groups. By default, “All Company” Group will be selected. And the Comment which we posted from the Office 365 will be posted in the Yammer Group “All Company”.

clip_image006

Now, let us see how to create a Yammer Group through the screen as well as C# Client side object model as well.

On the Yammer home page, click on the “Discover More groups” option.

clip_image008

On the right hand top corner, we can see the “Create Group” Button.

clip_image010

On the Screen, enter the group name, members, whether it is a Public or Private group.

clip_image012

Click on “Create Group”

That’s it. Yammer Group would have been created.

.

clip_image014

With this introduction, let us see, how to create a Yammer Group Programmatically.

It is a straight forward method

 using Microsoft.SharePoint.Client;
 using OfficeDevPnP.Core.Framework.Provisioning.Connectors;
 using OfficeDevPnP.Core.Framework.Provisioning.Providers.Xml;
 using System.IO;
 using System.Net;
 using System.Text;
 
 namespace Office365.Console
 {
     class Program
     {
         static void Main(string[] args)
         {
             CreateYammerGroup();
         }
 
         public static void CreateYammerGroup()
         {
             string url = "https://www.yammer.com/api/v1/groups.json";
 
             string access = "&private=false"; // This is for PUBLIC group.  For Private Group - "&private=true";
             string groupUrl = string.Format("{0}?name=" + "YammerGroupName" + "{1}", url, access);
 
             string result = PostYammerJson(groupUrl, "<<ADMIN ACCESS TOKEN OF THE YAMMER TENANT>>");
         }
 
         public static string PostYammerJson(string url, string accessToken)
         {
             //make the request
             string json = null;
             HttpWebRequest YammerRequest = HttpWebRequest.Create(url) as HttpWebRequest;
             YammerRequest.Method = "POST";
             YammerRequest.ContentType = "application/json; odata=verbose";
             YammerRequest.Accept = "application/json; odata=verbose";
             YammerRequest.ContentLength = 0;
             YammerRequest.Headers.Add("Authorization", string.Concat("Bearer ", accessToken));
 
             using (HttpWebResponse response = YammerRequest.GetResponse() as HttpWebResponse)
             {
                 Encoding encode = Encoding.GetEncoding("utf-8");
                 StreamReader reader = new StreamReader(response.GetResponseStream(), encode);
                 json = reader.ReadToEnd();
             }
             return json;
         }
 
     }
 }
 

Happy Coding,

Sathish Nadarajan.

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

How to Enable Yammer for SharePoint Office 365

Sathish Nadarajan
 
Solution Architect
August 12, 2016
 
Rate this article
 
Views
4192

In the recent years, Microsoft is leveraging Yammer into the next level. By default, when we purchase a SharePoint Office 365 licence, we are getting a Yammer as well. This clearly shows that going forward, Microsoft is planning to keep Yammer as its one stop shop for the collaboration portal.

As a first step, let us see, how to enable the Yammer on our SharePoint O365 Environment.

By default, when we upload a document, we can see the Follow Option in SharePoint O365.

image

But, when the Yammer is enabled, this Follow will be replaced with POST.

image

Now, let us see What change needs to be done for this.

Go to the Admin Centre of SharePoint Online. In my case it is https://sppalsmvp-admin.sharepoint.com/

Click on Settings.

 

image

 

Scroll down to see the option Enterprise Social Collaboration.

image

By default, it will be “Use SharePoint Newsfeed”.

Change that to “Use Yammer.com Server”.

image

Click on OK. Wait for some time. After the background timer jobs executed, the options on the Site will get change. Note : The change will not reflect immediately.

Now, let us go back to the site and see the document.

We will get the POST Link.

image

On click that, we will get a popup window with a text box to type the comments.

 

image

 

If we closely watch the URL, the Yammer Account URL will be,

https://yammer.com/<<tenantname>>.onmicrosoft.com

We can directly login to the Yammer site and see the posted message, post new messages, create new groups etc.,

 

image

 

Happy Coding,

Sathish Nadarajan.

Author Info

Sathish Nadarajan
 
Solution Architect
 
Rate this article
 
Sathish is a Microsoft MVP for SharePoint (Office Servers and Services) having 15+ years of experience in Microsoft Technologies. He holds a Masters Degree in Computer Aided Design and Business ...read more
 

Enterprise social networking with YAMMER

Sarath Babu Koneti
 
SharePoint Consultant
October 23, 2013
 
Rate this article
 
Views
12182

Nowadays where ever you go, which ever direction you turn on, one most often buzzing thing among corporate circles is enterprise social networking. I started digging in to this to find some information.

Just sharing my personal thoughts on enterprise social network with yammer.

Just think of the communications we had with our family and friends pre –face book era and post face book era. Communications are fantastic nowadays. It’s instant even across different geographies/time zones. A friend from US posts a pic, someone from UK, Dubai, Singapore likes/comments in short span of time. Just link this to corporate communications, emails where a thing of the past in few companies. If someone sends an email from one time zone, waiting the other person to reach work and then reply …there is something missing. There comes enterprise social networking to give the same benefits to corporates as well.

In my opinion MS was lacking in the enterprise social space, even though there are a massive changes with SharePoint 2013, they felt that something was missing. Acquiring yammer has given the much needed push to brand themselves as one of the market leaders in this space.

Microsoft where ever they see that they are lacking they go in for a big acquisition with their big bucks and make it up ~ rebrand / integrate them with their own suite of products. Like Hotmail, Skype or Nokia mobile, so is Yammer in their social enterprise space.

Now Microsoft can boast themselves as one of the market leader / or a serious contender in the enterprise social space.

Companies are trying to invest more in engaging with employees in more meaningful ways, trying to hear from all the folks irrespective of their defined hierarchy.

With office 365 or SharePoint online, SharePoint newsfeed was the organizations enterprise social collaboration tool.

But when we sign up with yammer for social collaboration, we can remove news feed from our SharePoint online and replace the same with Yammer or live with both. Once we plan to have both then we can’t post to everyone using news feed. That option will be disabled.

If we want to activate yammer for your organization (SharePoint online or Office 365) then the options available are

#1 if you / your organization are a MS enterprise agreement customer, you can activate yammer enterprise for free.

#2 if you / your organization is not a MS enterprise agreement customer then below are the options available to you. https://about.yammer.com/pricing/

clip_image002

Hopefully Microsoft will completely integrate Yammer with its enterprise agreement and solve most of the confusion that’s prevailing now.

As in the past how we are having personal mails and office mails we will be moved to personal social networking and professional social networking with a significant shift in adding value to business.

Any one with a sharepoint online subscription will be having newsfeed by default.

Sign up for yammer

clip_image004

clip_image006

Check your official account, you would have received the below email. Click Complete sign up.

clip_image008

Next Steps

#1 Create Profile

 
Welcome, Sarath Koneti!
Yammer is a private, secure enterprise social network. We make it easy to collaborate in teams and stay up to date on what others are working on.
    Get Started   

Here are some ways to get started:
clip_image010Complete Your Profile

Upload a picture and complete your contact information so others can easily reach you.
Start Now »

clip_image012Create a Group

Create private or public groups to ask questions, share information, and work together in small teams.
Start Now »

clip_image014Start a conversation

Let others know what you are working on to share ideas and get feedback on your projects.
Start Now »


Thank you,
The Yammer Team

clip_image016
Yammer Inc., 1355 Market Street, 3rd Floor, San Francisco, CA 94103

To change your notifications settings, go here.

clip_image017

#2 Follow colleagues, by giving their emails

clip_image018

#3 Join Groups

clip_image019

#4 Add your Pic

Mostly you are done. You have set up your private social network for your company.

clip_image021

With SharePoint on premise, we can install yammer app for SharePoint by purchasing the app from SharePoint store. Will go in further detail in our future posts.

It’s the time to move on. Go yammer Go!

Happy Sharepointing

Sarath Babu Koneti

Yes Labs Pty ltd.

Category : Yammer

Author Info

Sarath Babu Koneti
 
SharePoint Consultant
 
Rate this article
 
Working as a Sharepoint Consultant ~ Yes Labs Pty Ltd, Sydney ...read more
 

How to Communicate with Yammer from SharePoint 2013

Anne Jes Medon
 
SharePoint Developer
February 15, 2013
 
Rate this article
 
Views
15884

This article shows how to interact with Yammer and get the live feeds to your Web Part. This Web Part page can be used with in your intranet of your organisation, mainly the live feeds will be available in Web Part and the yammer page as well.

Yammer is an Enterprise social network which was acquired by Microsoft. In SharePoint we can able to get the feed from external site as well. Like social network the feed works fine here.

Step 1:

Initially login to your yammer network and click groups from the left menu and click Embed This Feed Link. There is a script that generated by yammer, shows your domain and group id.

clip_image002

Step 2:

After created the embed link from yammer, create a project in Visual Studio 2012 and open new project as Visual Web Part from SharePoint Solutions

clip_image004

Step 3:

Paste the code inside the Visual Web Part

clip_image006

Step 4:

Rebuild the Solution and Deploy

Step 5:

Open the site and add the Web Part then save the page, now you need to sign in to Yammer page and Allow your feed to available for SharePoint Environment as below.

clip_image008

Step 6:

Now you can able to interact with your group from portal and Yammer

clip_image010

Step 7:

The same conversation will also be there in yammer

clip_image012

You can also able to create this feed through Edit source of the Format text Ribbon.

Category : SharePoint, Yammer

Author Info

Anne Jes Medon
 
SharePoint Developer
 
Rate this article
 
Works as SharePoint Developer in Chennai, India. ...read more
 

Leave a comment