Discover: Communication Channels

Learn how to push messages from Enboarder to Slack and Microsoft Teams!

Adam Faludi avatar
Written by Adam Faludi
Updated over a week ago

This guide will help you configure Enboarder to push messages to Slack and Microsoft Teams!

It is important to note that your IT team will be required to set this up. Our scope of support is limited to our own product so please ensure that you have your IT expert ready! 😎


How to push messages to the Slack channel using the OAuth2 tile and webhook

Step 1: Create a Slack App

Create a Slack app by logging into the Slack app portal as an administrator:

  • Open the tab in a browser and navigate to the App directory:https://api.slack.com/apps

  • Here you will see all of your apps created for your organization.

  • Click on the ‘Create New App’ button

  • On the next page, select ‘From scratch’

  • On the next page, enter the app name (e.g. "Enboarder App") and select Development Slack Workplace as the workplace where the integration needs to be added. Click on ‘Create App’.

    • If you have the Enterprise Grid version of Slack, you may see multiple workspaces. Please select any one workspace of your organisation. You can decide later if you want to install the app on this workspace or not

  • Click on ‘Create New App’ button

  • On the next page, select ‘From scratch’

  • On the next page, enter the app name (e.g. "Enboarder App") and select Development Slack Workplace as the workplace where the integration needs to be added. Click on ‘Create App’.

  • If you have the Enterprise Grid version of Slack, you may see multiple workspaces. Please select any one workspace of your organization. You can decide later if you want to install the app on this workspace or not

  • The system will create the App and display the App home page

  • Click on Basic Information and navigate to the display information section. Update the logo and background colour and other branding detail (if required). This is an optional step

  • Now Click on the ‘OAuth and Permissions’ menu link under the ‘Features’ sections.

  • Navigate to ‘Scopes’ and give access of chat:write:user and user:read:email permission to the app

For this, type chat:write in select permission scopes search text and select ‘Send message as user’. This will be added to the scope. Now, type user:read:email on the search field and select ‘View email addresses of people on this workspace’. This will also be added to the scope. Also, add user:read scope ‘Access your workspace's profile information’ as well. Now press save changes.

The below 3 scopes are required in Bot Token scope:

1. chat:write

2. users:read

3. Users:read:email

  • If you are using Slack Enterprise Grid and you are building an organisation-wide app, then please skip the next steps and follow the Slack Enterprise Grid section below

  • If you don’t have Enterprise Grid, please follow the below steps

  • Install this app on the workspace. For this, go to ‘Basic Information’ and expand the section ‘Install your app to your workspace’

  • Click on "Install App to workplace"

  • Click on ‘Allow’

  • Click on the ‘OAuth and Permissions’ menu link under the ‘Featured’ section. Note down the "Bot User OAuth Access Token" from this page. This token needs to be entered in the Enboarder application when configuring the Slack integration.

Slack Enterprise Grid - Organisation-wide App

If you are using Slack Enterprise Grid and want to provide App access to multiple workspaces (as different workspaces may have a different set of users), please opt-in for the org-wide app.

Org wide App

An org-wide app is an extension of a regular Slack app. The difference is that it can be deployed across an entire organization. These apps are installed once, at the org level, and have a single token that represents the permissions for the app on many workspaces.

In case you have an existing app already installed in one workspace and you want to convert to the org-level app, follow these steps first.

Uninstall the app for the workspace and revoke all tokens. Then install it again at the org level and provide access to all Workspaces. After that, it starts working across workspaces.

Our suggestion is to create a fresh app instead of migrating of any existing app.

Opt into org-wide deployment

  • Go to your ‘App Config’ → ‘Setting’s → ‘Org Level Apps’ and press ‘Opt-in’

  • Go to the ‘OAuth and Permissions’ menu link under the ‘Features’ sections. You will see the ‘Install to Organization’ button under the ‘OAuth Tokens for Your Workspace’ section

  • Please click on ‘Install to Organization

  • The system will show an authorization page, please click on the ‘Allow’ button

  • On successful installation, you will return to the ‘OAuth and Permissions’ page and you will see the OAuth token. Copy and note this. This is required in the next step when we are integrating the Enboarder tile.

Keep in mind: even once an Org Admin installs your app across the entire Org, it has not yet been added to any workspaces in the org yet. As a next step please add this app to your workspaces

Adding an app to Workspaces

Once OAuth has been completed, head to the admin portal to add this app to individual workspaces.

  • Login to https://app.slack.com. Then sign in as an org owner user.

  • Once logged in, click on the Manage Organization button

  • On this page, click on the app you have created for Enboarder, and on the next page click on Add to more workspaces button and select all the workspaces to which you want to give access and provide access.

  • The system will show you the permission and ask for authorization. Please review and click on ‘Add App’

  • After a few minutes, the app will be added to all selected workspaces.

  • The next step is to add this token to the Enboarder tile. Please follow the next steps:

Step 2: Add a new Custom tile in Enboarder to set up the Integration

Once the token is generated from Slack, in Enboarder click on the settings tab, then select the App Center and click the Slack tile.

  1. Go to Settings → Apps and Integration → App Center page

2. Select the Slack tile

Click the Slack tile, select Integrate, and enter the Access token and Slack domain details. Click Integrate Now. It’s that simple!

NOTE: Enter the email domain here, not the Slack domain. If you have multiple email domains, please enter the values separated by commas.

Step 3: Import the Slack Webhook from Discover and add to your Workflow

In Enboarder, go to Discover and search for the Slack message

On the Slack message webhook page, select Add to My Assets to import the Webhook. Click through the screens until you reach the Success page and the asset is added to your Modules list.

Once the Webhook is added to your account. Add the Slack channel to post the message to, check the configuration settings (as below), and update the details for your message.

Basic information required to send a message

  • Before sending a message using API, please log in to your Slack account and note down the below information:

    • ChannelID

  • Login to your account and select Channel where you want to send messages. Right-click on the channel and select Open ‘Channel Detail options’

  • Scroll down to the bottom of the detail window. At the bottom, you will see the channel id. Copy and note down this value, eg:

Web-hook Settings

Header section:


Content-type: application/json
Authorization: Bearer xoxb-your-token

----Here is sample body------

{
"channel": "YOUR_CHANNEL_ID",
"text": "Hello world :tada:"
}

Once successful you will get the below response

Sample Response

1{
2 "ok": true,
3 "channel": "XXXXXX",
4 "ts": "1629185542.000100",
5 "message": {
6 "bot_id": "XXXXX",
7 "type": "message",
8 "text": "This content
9 }
10}

Step 4: Launch the Workflow to automate the sending of the message to the Slack channel

Add the Webhook to your Workflow. When the Workflow is launched and the sequence triggered, the webhook will send the message to the Slack channel.

References


How to push messages to MSTeams using the OAuth2 tile and webhook

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

Step 1: Get the Tenant ID

Prerequisites

  • The organization must have an admin account in Microsoft Teams and all users must have permission to Team General channel

  • The admin user must install Enboarder APP in Microsoft Teams

  • To configure the tile, the user needs to follow the below steps to get TenantID, Bot ID and secret key.

Before configuring the tile, please follow the 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 a message. Click on Get a link to the General channel

Click, to copy and paste into a Notepad

It will look some thing like this:

The channel ID is 19%3A2a53a6b4bec04ff89ee-XXXXXXXXXX

Please note down these values for future reference.

Step 2: Add/Configure a new Custom tile in Enboarder to set up the Integration

Here are the steps for Integration:

  1. Go to Settings → Apps and Integration → App center page

2. Click on the tile Microsoft Teams (or search if you can't see it) and click on the Add Integration button.

  • On the next screen, enter the tenant id which you have noted previously and click on the Integrate Now button.

  • On successful authentication, the user will be redirected to the Enboarder site, and the "Microsoft Tile" will be shown as Pending.

Install Enboarder App and add a bot to Teams

Install Enboarder App

Click on the Apps icon at bottom of the left pane. Then either search the App by typing enb or Enboarder. Or you can go to the Human resources category and browse for Enboarder App.

Now click on Enboarder App. You will see the details page. On the detail page click on the “Add to a team” option from the dropdown menu.

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.

Note - In case you have multiple Accounts in Enboarder and you want to Integrate all or some specific accounts. You can do that by send Account Name in message.

Ex- Say you have three accounts in Enboarder with Names Acct-1, Acct-2 and Acct-3. And you want to Integrate with Acct-1 and Acct-2. Then send the message with Account like below

Similarly for Next Account

Now go to Enboarder and click on Settings -> Apps and Integrations -> App Center

You will see the tile as Integrated into the respective account.

Now you can send notifications to MSTeams from Enboarder. For example, a new hire notification, the message will look like the below:

Note - The email address of the employee in Enboarder must be the same email address that they use in MSTeams.

Step 3: Import the MS Teams Webhook from Discover and configure it

In Enboarder, go to Discover and search for the Message to Teams channel webhook

On the Message to Teams channel webhook page, select Add to My Assets to import the Webhook. Click through the screens until you reach the Success page and the asset is added to your Modules list.

Once the Webhook is added to your account. Add the MSTeams channel to post the message to, check the configuration settings (as below), and update the details for your message.

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

The channel ID is 19%3A2a53a6b4bec04ff89ee-XXXXXXXXXX

Sending messages to channel

In the webhook, Add the URL - https://botserver/sendmessages

Update the Authentication method to the newly created MS Teams tile.

Sample Payload 1:

{

"channelid": "19%3A2a53a6b4bec04ff89ee8a12a46571dc6%40thread.tacv2"
"message": "Hi Team, {{newhire_firstname}} joining our team on {{newhire_startdt}}"
}

Response:

Once successful you will get the below response

{
"id": "1590470249921"
}

While configuring the webhook, please select authentication as Microsoft Team and remove any additional header/key row.

Launch the Workflow to automate the send of the MS Teams message

Add the Webhook to your Workflow. When the Workflow is launched and the sequence triggered, the webhook will send the message to the MS Teams channel.

References

  • Office 365 login

  • Go to the admin center to view all the different portals

Microsoft team portal login

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?

  • Get Conversation Members API

  • Get member detail


Got questions? Reach out to support by clicking on the ? button at the top right corner of any Enboarder page!

Did this answer your question?