Now you can communicate with your employees via Teams!

This document provides detail on how Enboarder will interact with Microsoft Teams to send new hire notifications to a company channel and proactive messages to users, including the endpoints and configuration required. We are using the Microsoft Bot framework Rest API to send messages.

Pre-requisite

  • The organization must have an admin account in Microsoft Teams and all Azure AD users must have permissions to Team General channel
  • The admin user must install bot in Microsoft Teams using the App Studio.
  • To configure tile, the user needs to follow the below steps to get TenantID, Bot ID, and secret key.


Set up APP using App Studio and get bot detail

  • Login to Microsoft Teams

Use App Studio to update the app package

App Studio is a Teams app that we can install from the Teams store. If App Studio is not already installed, use the below App to install it.

To install App Studio in Teams, click on the app store icon at the bottom of the left-hand bar, and search for App Studio.

Once you find the tile for App Studio, click on it and choose install in the dialog that pops up.

Once App Studio is installed click on the Manifest editor tab to begin creating the app package for your Teams app.

Import App and Generate the Bot secret

Download the zip file Enboarder.zip for App package

Please contact your Customer Success Manager to access this file.

Go to App studio and modify this app package by selecting the Import an existing app tile in the Manifest Editor.

Navigate and select the enboarderbot.zip file.

Click on the tile for your newly imported app, Enboarder Bot to see App detail page

There is a list of steps on the left-hand side of the Manifest editor, and, on the right, is a list of properties that need to be filled in for each of those steps.

Since you started with a sample app, much of the information is already filled out. The next steps will walk you through changing the parts that still need to be updated.

Branding

If you want to put your own logo and email, then please change below detail

  • Short name in App detail page. Update with your company name.
  • Update the logo in the Branding section
  • In the Bot section, update the bot name in setup

App details

Click on the App details entry under Details. Click the Generate button to create a new app id.

Your new app id should look something like this: 2322041b-72bf-459d-b107-f4f335bc35bd.

Bots

The bot that was imported from the sample does not have an App ID associated with it yet. You will have to create a new bot so that App Studio can create a new App ID and register it with Microsoft.

Note that this is the App ID for the bot, which is different from the App ID that we created for the app in the earlier step. Each bot in an app requires its own App ID.

Click the delete button next to the Imported bot in the bot list.

Now there are no bots left to show. Click Setup. This will display the Set up a bot dialog.

Add a bot name as EnboarderBot or your company name, and click both the buttons under Scope.

Choose Create bot to exit the dialog. App Studio will spend a moment registering your bot with Microsoft, and then should display your new bot in the bot list.

Now would be a good time to open a text file in notepad and copy/paste your new bot id into it. You will need this id later.

Click Generate New Password, and make a note of the password in the same text file you noted your Bot app ID in. This is the only time your password will be shown, so be sure to do this now.

Update the Bot endpoint address to https://enboaderserverURL/api/messages, where enboaderserverURL should be replaced by the URL as below, which is based on the region where your Enboarder account is hosted.

Base URLs

AU - https://msteams.syd.e1.enboarder.com/api/messages 
EU - https://msteams.fra.e1.enboarder.com/api/messages 
US - https://msteams.ore.e1.enboarder.com/api/messages

Now would be a good time to save your text file if you have not done so already.

Test and distribute

Click on Test and distribute under Finish in the left-hand column of App Studio.

Now you need to configure the tile in Enboarder and then again come back to this page.

Get Tenant ID

Before configuring the tile, please follow below steps and note down below information:

  • TenantID
  • ChannelID

Login to your account and go to the Teams tab. Right-click on the channel where you want to send the message. Click on Get link to General channel

Click, to copy and paste into notepad

It will look something like this

https://teams.microsoft.com/l/channel/19%3A2a53a6DDDDbec04ff89ee9a12a46577dc6%40thread.tacv2/General?groupId=c0581343-663e-42e8-a13d-3f67336dad1a&tenantId=680d22e1-e6f7-4ed7-8e9e-XXXXXXXXXXXX

The channel ID is 19%3A2a53a6DDDDbec04ff89ee9a12a46577dc6%40thread.tacv2

And the tenantID is 680d22e1-e6f7-4ed7-8e9e-XXXXXXXXXXXX

Please note down these values for future reference

Setting up the Microsoft Tile in Enboarder App

Here are the steps for Integration:

  • Login as admin user and go to Settings → Integration → App centre
  • Click on the tile Microsoft Teams (or search if you can't see it)
  • Click on the Add Integration button.
  • Click next on the second page.
  • On the next screen, enter the Bot ID, Tenant ID and Bot Secret Key which you have generated while registering the application bot, and then click on the Integrate Now button.
  • When successful authentication has been reached, the user will be redirected to the Enboarder site and the "Microsoft Teams" tile will be shown as Pending.

Add bot to the team

Now go back to the Microsoft Teams App studio page, go to the Test and Distribute section of Enboarder App.

Click on the install button.

On the next page click on the “Add to a team” option from dropdown menu.

Note - In some cases Add button is disable due to permission. In that case please select 'Upload as custom App” in trouble shooting section and click on the Download button. It will then download the app setting in a zip file.

Search for General channel and add it to the team.

On adding bot to teams, send a ‘Hi’ message to Enboarder and tile will show as Integrated.

On new hire notification, message will look like the below:

Send a message to channel using web hook

Basic information required to send a message

Before sending a message using api, please login to your Microsoft account and note down below information

  • ChannelID

Login to your account and go to the Teams tab. Right click on the channel where you want to send the message. Click on Get link to channel

Click to copy/paste into notepad

It will look something like this

https://teams.microsoft.com/l/channel/19%3A2a53a6b4bec04ff89ee9a12a46577dc6%40thread.tacv2/General?groupId=c0581343-663e-42e8-a13d-3f67336dad1a&tenantId=680d22e1-e6f7-4ed7-8e9e-5566ec1055b8

The channel ID is 19%3A2a53a6b4bec04ff89ee9a12a46577dc6%40thread.tacv2

Send message to channel API

Sending messages to channel

URL - https://botserver/sendmessages

Sample Payload 1:

{   "channelid": 

"19%3A2a53a6b4bec04ff89ee9a12a46577dc6%40thread.tacv2" "message":

"Hi Team, {{newhire_firstname}} joining our team on

{{newhire_startdt}}" }

Response:


Once successful you will get the below response

{     

"id": "1590470249921"

}

Webhook setting

While configuring web-hook, please select authentication as Microsoft Team and remove any additional header/key row

TroubleShooting

Upload App as custom App

First login as Teams admin portal and enable upload custom apps.

https://admin.teams.microsoft.com/dashboard

You will need to enable upload custom apps and change upload policies to new policy and assign it to a user. It may take some time to reflect the changes.

Now go to Microsoft team → Apps. You will see “Upload a custom app”.

Click on this link and select “Upload for me or my teams” option

In the next window select “Add to a team” and add it to general channel.

References

Office 365 login

https://admin.microsoft.com/Adminportal/Home?source=applauncher#/homepage

Go to admin center to view all different portal

Microsoft team portal login

https://admin.teams.microsoft.com/dashboard

Need to enable upload custom apps and change upload policies

To obtain personal chat's unique conversation id, we need to pass on member id, Is there any direct REST API available to obtain member id?

https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-proactive-messages?tabs=javascript

Get Conversation Members API

https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-connector-api-reference?view=azure-bot-service-4.0#send-to-conversation

Get member detail

https://docs.microsoft.com/en-us/microsoftteams/platform/bots/how-to/get-teams-context?tabs=json#fetching-the-roster-or-user-profile

Did this answer your question?