Bridge Communications

Saturday, February 18, 2017

Extending Office 365 Groups for Developers

Office 365 Groups put simply are a way to make collaboration in o365 easy.  The thing I love about them is they make setting end user permissions a simple task.  When I add someone to an Office Group, that user automatically gets access to that groups information in all services.  This means I don't have to touch their Outlook, Teams, Power Bi, etc.  Groups have really made distribution lists, and shared mailboxes obsolete, by easily replacing their feature set, and adding a ton of new function.

** One of the current advantages Groups has over Teams right now, is the ability to invite users from outside the organization.

I personally like to create the group in the mail portion of the o365 portal.  When you create a group in Outlook you get the following.


  • Shared Inbox – For email conversations between your members. This inbox has an email address and can be set to accept messages from people outside the group and even outside your organization, much like a traditional distribution list
  • Shared Calendar – For scheduling events related to the group
  • SharePoint Document Library – A central place for the group to store and share files
  • Shared OneNote Notebook – For gathering ideas, research, and information
  • SharePoint Team Site – A central repository for information, links and content relating to your group
  • Planner – For assigning and managing project tasks among your group members
If you have never used the shared inbox feature in Outlook, I would recommend setting one up, as I am about to show you how to connect an application to it, and post data.  I won't go through the entire feature set and everything groups can do, you can find that here.

Creating a Connector

This is almost the identical process as we used in Microsoft Teams the last 2 weeks in the blog, so keep that code handy as it also posts to Office 365 groups by changing only the webhook uri.


In our group we want to scan the top menu to find the Connectors tab, and click it.


From here we are presented a similar list of all the pre-build services,  the one for developers is called Incoming Webhook.  Find this option and click the Add button.


Just like Teams we will give our Webhook a name, and I recommend an image as well, especially if you are going to have multiple.  Once you click create, it is important that you copy the Webhook url, as you will need this later.

Sending a Message 

Just like last week, we will be using our custom classes to post to a Group.  In case you missed them last week, here they are again.







As you can see the Message class is a combination of the sub classes and it also holds a method for posting with a parameter of our webhook url.

Here is a sample piece of code that creates a simple console app, defines the message, then posts it to our Office Group.



Just change the code above to send to the outlookuri variable instead of the one we used for teams, and boom, you have send a message to an Office Group.

So what does the result look like?
 
This is a full blow card example with all the options.  If you want just a simple notification style message, you can send a message with as little as a title and message set.  So in our Outlook client if we find our group, and our posted message, you can see pretty easily where all the users in the group can have a persistent chat like conversation.  Now since it's still using email on the back-end to make this all work, it's not quite as real-time as teams, but still pretty nice.



Doug Routledge, C# Lync, Skype for Business, SQL, Exchange, UC, 
Full Stack Developer  BridgeOC Bridge Operator Console
Twitter - @droutledge @ndbridge














No comments:

Post a Comment

Any spam comments will be deleted and your user account will be disabled.