Settings up MS Teams Bot

Using Knit's Communication APIs, you can send text as well as interactive messages to any Teams channel or user either using Knit's Bot or your own Bot. In this guide, we will help you understand which kind of bot to use for development and production. Read on to know more.

Using Knit's Teams Bot

🚧

Knit Teams Bot is for only testing and getting familiar with communication APIs. For the production use cases, organizations must setup their own bots.

Using Knit MS Teams bot for communication purpose mainly requires two steps-

Adding Team link during setup

  1. Once you click on the MS Teams icon in the communication section of Knit apps.
  2. On clicking MS Team icon you have to add team link in which the bot needs to be installed. How to get teams link ?


Installing Knit's Bot in the team

  1. Knit bot will be installed via package file provided by us. Click on the Upload an app

  1. Then choose Upload a custom app . Add Knit's Package here. Knit's Bot Package

  1. After successful upload a pop will open when you click on - Add to a team

  1. Then select the General channel in populated channels list.

👍

Congratulations setup is done you can use this bot for development or testing purpose.


Using Your own Bot

👍

You should use your own Bot in production. Do not use Knit's Bot for production use cases.

This involves two step process -

  1. Create Your Bot with the MS Teams.
  2. You need to provide OAuth credentials to knit using Register OAuth Cred

Create your bot with MS Teams

1. You need Developer Portal App from Microsoft Teams Store to build MS Teams Bot.

2.After Installing it and open and navigate to Apps section.

3.Click On + icon New App to create app .

4.Add the name to you app and then you will be asked Developer name, Terms of use etc in the Basic Information section. Fill All the details carefully and click on the Save button.

5. Visit Branding section to add icon and other display information.

6. Click on App Features section and select Bot.

7. Next, create one Bot by selecting Create a new Bot.

8. You will get + icon to add new Bot.

9. After giving Name to the Bot, you need to configure end point address. Set this to Teams Bot End Point

10. Click on Client Secrets and then Generate Client Secret. Keep this handy it will be required during OAuth Registration with Knit.

10.Copy this key as it is one time secrets. After clicking OK you will be shown the below screen and Bot is configured.

11.Now you need to link this bot to your newly created App in Step 6. You will see this bot in the dropdown and select this Bot, then select Team scope and click on Save button.


Distributing Your App to clients

1. Click on publish button on the top right corner in the app home page.

2.You will get the following options.

To use within org select publish to org. For distributing to clients download the package .

3.If you have followed the right steps and filled in the necessary information, you will be able to download it .

❗️

If you miss any of mandatory fields errors will be listed for missing fields shown in the image below.

4. Here, developer website URL, privacy terms etc. missing. You need to fix all errors before you can download package. It can be used to install in any team using steps described in the section Using Knit's Team Bot.

You have now created your own MS Teams Bot! There's one small step to go before you can use Knit's API on your new Bot. Read on!


2. Register the OAuth creds like client ID and secret of your Bot with Knit

Share Bot's client ID (botId) and client secret with Knit via Register OAuth Cred API and that's it. You're all set to use Knit's API!