Unverified Commit 935319e0 authored by Fongang Rodrique's avatar Fongang Rodrique Committed by gitbook-bot
Browse files

GitBook: [#1575] Update MS Teams integration Incoming Webhook script

parent bd690e7b
......@@ -2,18 +2,18 @@
## Goal
* Receive message from Microsoft Teams \(**Incoming WebHook**\)
* Send message to Microsoft Teams Channel\(**Outgoing WebHook**\)
* Receive message from Microsoft Teams (**Incoming WebHook**)
* Send message to Microsoft Teams Channel(**Outgoing WebHook**)
## Create Incoming WebHook in Rocket.Chat
_**Note:** I would advise to create New Team so not all members in your organisation have access to this Integration_
1. **Create Incoming Webhook with Default parameters:**
* Go to **Integrations** --> Create **New integration** --> Select **Incoming WebHook**
* Go to **Integrations** --> Create **New integration** --> Select **Incoming WebHook**
* Assign **Name**
* Assign **Post to Channel** \(This will be the Channel where you want to recieve msg from Teams\)
* Assign **Post as** \(Create Bot user and add bot the above mentioned Channel\)
* Assign **Post to Channel** (This will be the Channel where you want to recieve msg from Teams)
* Assign **Post as** (Create Bot user and add bot the above mentioned Channel)
* Copy and paste below script in **Script** section
```javascript
......@@ -38,13 +38,27 @@ class Script {
}
}
return {
content: {
username: who,
icon_url: icon_url,
text: body
}
};
return {
content: {
username: who,
icon_url: icon_url,
text: body,
},
response: {
type: "message",
attachments: [{
contentType: "application/vnd.microsoft.card.adaptive",
content: {
type: "AdaptiveCard",
version: "1.4",
body: [{
type: "TextBlock",
text: "Message received",
}],
},
}],
}
};
}
}
```
......@@ -53,24 +67,24 @@ class Script {
## Create Outgoing WebHook in MS Teams:
1. Select the appropriate team and select **Manage team** from the \(**•••**\) drop-down menu.
1. Select the appropriate team and select **Manage team** from the (**•••**) drop-down menu.
2. Choose the **Apps** tab from the navigation bar.
3. From the window's lower right corner select Create an **outgoing webhook**.
4. In the resulting popup window complete the required fields:
4. In the resulting popup window complete the required fields:
* **Name** - The webhook title and @mention tap. \(This will be your bot name in MS Teams\)
* **Callback URL** - Paste the URL here we copied from Rocket.Chat.
* **Description** - A detailed string that will appear in the profile card and the team-level App dashboard.
* **Profile Picture** \(optional\) an app icon for your webhook.
* Select the **Create** button from lower right corner of the pop-up window and the outgoing webhook will be added to the current team's channels.
* **Name** - The webhook title and @mention tap. (This will be your bot name in MS Teams)
* **Callback URL** - Paste the URL here we copied from Rocket.Chat.
* **Description** - A detailed string that will appear in the profile card and the team-level App dashboard.
* **Profile Picture** (optional) an app icon for your webhook.
* Select the **Create** button from lower right corner of the pop-up window and the outgoing webhook will be added to the current team's channels.
_**Note :**_ _The Name We mentioned above will be the bot name so when you send message to Rocket.Chat Mention to Bot example @namebot_
_**Note :**_ _The Name We mentioned above will be the bot name so when you send message to Rocket.Chat Mention to Bot example @namebot_
\_\_
\_\_
## Create Incoming WebHook in MS Teams:
1. Navigate to the **Team** where you want to add the webhook and select \(**•••**\) **More Options** from the top navigation bar and Select **Apps** and select **More apps**.
1. Navigate to the **Team** where you want to add the webhook and select (**•••**) **More Options** from the top navigation bar and Select **Apps** and select **More apps**.
* Choose **Connectors** from the drop-down menu and search for **Incoming Webhook**.
* Select the **Configure** button, provide a name, and, optionally, upload an image avatar for your webhook.
* Select appropriate **Teams** and **Channel**.
......@@ -81,9 +95,9 @@ class Script {
1. Create **Outgoing WebHook** from Integration:
* Select **Message Sent** as **Event Trigger**
* Select the **Channel** \(same as mentioned in Incoming Webhook\)
* Select the **Channel** (same as mentioned in Incoming Webhook)
* Paste the **URL** we copied from Microsoft Teams
* Select Bot **Post as** \(same as in Incoming Webhook\)
* Select Bot **Post as** (same as in Incoming Webhook)
* Paste Below **Script**:
```javascript
......@@ -113,4 +127,3 @@ class Script {
```
## Enjoy!
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment