Send a notification to a Teams Chat in Boomi (and get started with Microsoft Graph API)

From Microsoft: The Microsoft Graph API offers a single endpoint, https://graph.microsoft.com, to provide access to rich, people-centric data and insights in the Microsoft cloud, including Microsoft 365, Windows, and Enterprise Mobility + Security

Microsoft Graph API can be used for a vast array of integrations with Microsoft products used at UConn, such as Outlook Mail and Calendar, OneNote, OneDrive, SharePoint, and more. Many groups communicate mainly through Teams, so we thought that a Teams message would be the best way to alert a group about a problem with a Boomi integration.

You must first set up in Azure to ensure the user account has the permissions needed to use any particular Microsoft Graph API. For this example, it made sense to create a service account, boomi-notify@uconn.edu.

Before building the process in Boomi, we added the boomi-notify@uconn.edu user to a group chat:

 

We needed the ID of the chat, which we found by using Postman and the Microsoft Graph Collection and sending a GET to

https://graph.microsoft.com/v1.0/users/boomi-notify@uconn.edu/chats

This is a shared service account, so if your project team is using it, be sure to use the ID associated with a chat dedicated to your project team.

This article is intended for individuals who have a Boomi Associate Integration Developer Certification. If you do not know how to complete an action like “add a message shape,” please complete the recommended trainings.

 Instructions

The message that is most helpful to send in teams will be particular to your use case. For this guide we decided to call an api that returns a random quote in JSON format and send that to our Teams chat. This simple process looks like:

You can do the same, add complexity or remove complexity up to the Map shape.

  1. Whatever precedes the map shape (Teams content ff to json) needs to be mapped to the proper JSON format, defined in the Teams Message JSON profile. Your map shape should populate the content element as shown below

  1. The Map shape connects to an HTTP Client Connection. The Connections looks like:

URL: https://graph.microsoft.com
Authentication Type: OAuth 2.0
Grant Type: Authorization Code
Client ID: find in Last Pass
Client Secret: find in Last Pass
Authorization Token URL: https://graph.microsoft.com
Scope: ChatMessage.Send offline_access ChannelMessage.Send
Access Token URL: https://login.microsoftonline.com/17f1a87e-2a25-4eaa-b9df-9d439034b080/oauth2/v2.0/token
Refresh Authorization Scheme: Refresh Body Parameters

 

URL: https://graph.microsoft.com
Authentication Type: OAuth 2.0
Grant Type: Authorization Code
Client ID: find in Last Pass
Client Secret: find in Last Pass
Authorization Token URL: https://graph.microsoft.com
Scope: ChatMessage.Send offline_access ChannelMessage.Send
Access Token URL: https://login.microsoftonline.com/17f1a87e-2a25-4eaa-b9df-9d439034b080/oauth2/v2.0/token
Refresh Authorization Scheme: Refresh Body Parameters

 

  1. The Teams Post Operation looks like:

Select Request Profile Type: JSON
Request Profile: Teams Message JSON
Select Response Profile Type: None
Content Type: applicaiton/json
HTTP Method: POST
_______________________________________________
In Request Headers Add

Name = Accept and Value = */ *

________________________________________________

In Resource Path Add
Name = v1.0/chats/{your chat id here}/messages

 

Select Request Profile Type: JSON
Request Profile: Teams Message JSON
Select Response Profile Type: None
Content Type: applicaiton/json
HTTP Method: POST
_______________________________________________
In Request Headers Add

Name = Accept and Value = */ *

________________________________________________

In Resource Path Add
Name = v1.0/chats/{your chat id here}/messages

 

  1. Add a Stop shape to the Http Client Connector

  2. Click the Test button on the Process Pallet

  3. Select the appropriate test atom cloud:

  4. You should see a teams notification on the chat id you specified:

  5. You should also see the green halos around each shape in the Process Pallet as Boomi moves successfully through the steps:

     

You should now be able to re-use this same HTTP Client configuration to send appropriate teams messages within your Boomi process or change the operation (and scope) and implement other Microsoft Graph API calls.

 Related articles