Skip to main content

Microsoft Teams

Microsoft Teams (MS Teams) is a collaboration platform that provides a digital workspace for various teams within the organisation to communicate and work together. The team members can have conversations, share files, images, video, audio, and schedule meetings. It includes chat, video meetings, file storage, and application integration to provide a secure, collaborative environment for teams to work together.

MS Teams channel integration helps businesses to automate customer support, send campaigns, and collect user feedback.

This channel enables the following key features:

  • Automated Replies: Provides the ability to automatically respond to user messages.
  • Multi-message type support: You can use various message types that are supported by the platform to enhance the communication experience.

Setting up MS Teams on Yellow.ai platform

To set up MS Teams

Prerequisite

To set up MS Teams chatbot, create a MS Teams account.

Set up MS Teams chatbot using Developer portal

To set up MS teams using Developer portal, follow these steps:

Create a bot on MS Teams

  1. Open MS Teams.

  2. Navigate to Apps and search for Developer Portal.

  3. Open Developer Portal.

  4. Navigate to Tools > Bot Management.

  5. Click + New Bot to set up a bot.

  6. Enter the bot's name and click Add.

  7. Click Configure to establish a messaging endpoint.

  8. To ensure a secure connection with the bot and facilitate interaction, you need to enter a valid endpoint URL as per your region (to deploy the bot) and click Save to save your settings.

    For example: https://cloud.yellow.ai/integrations/botframework/123?profileId=testbot

note

Enter your preferred profile ID name in the URL provided below, ensure it only contain underscores and lowercase letters. This profile ID is specific to your region and must be consistent with the profile ID you specify in step 3 of the Connect MS Teams app to the Yellow.ai platform process.

Region CodeRegionURL
R0Indiahttps://r0.cloud.yellow.ai/integrations/botframework/${botId}?profileId=${profileId}
R1MEA-UAE Northhttps://r1.cloud.yellow.ai/integrations/botframework/${botId}?profileId=${profileId}
R2Jakartahttps://r2.cloud.yellow.ai/integrations/botframework/${botId}?profileId=${profileId}
R3Singaporehttps://r3.cloud.yellow.ai/integrations/botframework/${botId}?profileId=${profileId}
R4USAhttps://r4.cloud.yellow.ai/integrations/botframework/${botId}?profileId=${profileId}
R5Europehttps://r5.cloud.yellow.ai/integrations/botframework/${botId}?profileId=${profileId}

  1. Go to Client secrets and click Add a client secret for your bot.

  2. Copy the Client secret and save it for future reference.

  3. Go to Developer portal > Tools > Bot management and copy the client ID (Bot ID). This is required to connect MS Teams app to Yellow.ai platform.

Create an app on MS Teams

You need to create an app in MS Teams and connect your bot.

  1. Navigate to Apps to create a + New app. Click + New app.

  2. Enter a name for the app.

  1. Enter the following details that are required for your app and click Save to save your settings:
OptionDescription
Short NameEnter a name (30 characters or less) for your bot app.
Full NameEnter a full name (up to 100 characters) for your bot app. It can be the same as the short name. This is optional.
App IDThis is the unique identifier generated by Microsoft for your app.
Short DescriptionEnter a brief description (80 characters or less) for your bot app.
Long DescriptionEnter a detailed description (80 characters or less) for your bot app.
VersionEnter the version number as 1.0.0 (for developer reference).
Developer or Company NameEnter your organization's name.
WebsiteEnter your website URL (HTTPS only).
Privacy PolicyAdd the link of your website's privacy policy.
Terms of useAdd the link of your website's terms of use.
Application (client) IDPaste the bot ID (client ID), which you have copied earlier (as mentioned in the Step 11 of Create a bot on MS Teams section).
Microsoft Partner Network IDIf you are part of the Microsoft Partner Network, specify your MPN ID. For more information, refer to this link.
drawing
  1. Navigate to Branding under Configure to change the available branding options.

  2. Navigate to App Features under Configure and select Bot.

  3. Select your bot name from the drop-down.

  4. If you want to enable file sharing, enable the Upload and download files check box.

  5. Select Personal under the scope.

  6. Click Save at the bottom.

Publish App on MS Teams

  1. To publish the app, navigate to Publish > App package.

  2. Click Publish your app. The following options will be displayed:

    • Download the app package: This option allows you to download a copy of your app package. It is recommended to select this option.
    • Publish to your org: Use this option to submit a request to your IT admin for publishing the app within your organization. This ensures that the app is available for use by members of your organization.
    • Publish to the Team store: Selecting this option will make your app available to all Microsoft Teams users. It is not recommended to select this option.

  3. Click Download the app package. The file will be downloaded to your local folder.

    drawing
  1. Go to https://admin.teams.microsoft.com.

  2. Navigate to Teams Apps > Manage Apps > Upload new app.

  3. Select the downloaded file from your local folder and click Upload.

    drawing
  • A new app will be added to your apps list.

    drawing
note

Once the app is added, you need to log out and log in to the MS Teams app.

Add app to MS Teams workspace

  1. Go back to MS Teams.

  2. Search the App under Apps.

  3. Click Add to start a conversation with the bot.

Set permission on Azure portal

After adding app to MS Teams workspace, you need to set permissions on the Azure portal to execute certain use cases based on the business requirements. Follow these steps:

  1. Login to https://portal.azure.com.

  2. Navigate to App Registration.

  3. Click on View all applications in the directory to view the created app.

  4. Click on the app created with the same name as your MS Teams bot.

  5. Click Authentication > select Multitenant > Click Save.

  6. Click Add a Platform > Web.

  • Configure web page is displayed. Configuring the web page is an optional step for using the Graph API.

  1. Navigate to API Permissions > Add Permission > Microsoft Graph.

  2. To enable app permissions, select the desired permission type and click Add permissions. This step is optional. If you wish to use Microsoft Graph, you can select the following permissions.:

    • Application Permissions: This enables the app to use the services without any user’s authorization. The app work with its credentials.

    • Delegated Permissions: This requires users to authorize the app to work on their behalf. Once approved, the app contains the privileges of authorising users for the defined scope. For more detailed information regarding permissions, click here.

Connect MS Teams app to the Yellow.ai platform

  1. On the left navigation bar, click Extensions.

  2. Click Channels > Messaging > MS Teams.

  3. Copy the Profile ID based on the region where you want to deploy the bot, as mentioned in step 8 of Create a bot on MS Teams.

  4. Copy the Client Secret as mentioned in step 10 of Create a bot on MS Teams.

  5. Copy the Bot ID as mentioned in step 11 of Create a bot on MS Teams paste it under Client ID.

  6. Click Save.

  7. Navigate to the Overview page, under the Active channels section, you can see that the MS Teams channel is successfully connected to your bot.

  8. Once the MS Teams channel is successfully connected to the bot, copy the Webhook URL.

  9. Go to MS Teams app > Developer portal > Tools > Bot management > paste end point URL > Save.

MS Teams user data syncing in User 360/Engage

To sync users in MS Teams, follow these steps:

  1. Copy the existing MS teams credentials from the Channels page.

  2. Disconnect MS Teams.

  3. Use the below API to reconnect Teams. Before calling the API, ensure to update parameters such as BOT_ID, API_KEY, PROFILE_NAME, CLIENT_ID, CLIENT_SECRET, and TENANT_ID with the appropriate values.

curl --location 'https://cloud.yellow.ai/api/data/vault/botframeworkTokens?bot=BOT_ID' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'x-api-key: API_KEY' \
--data '{
"profileId": "PROFILE_NAME",
"clientId": "CLIENT_ID",
"clientSecret": "CLIENT_SECRET",
"tenantId":"TENANT_ID"
}
  • Verify if the custom properties (teamsConversationId, countryName, jobTitle, officeLocation) are added in your Customer Data Platform (CDP). If any of these properties are missing, manually add them to the user properties.
  1. Execute the below curl command, replacing the placeholders with your specific values such as botId, x-api-key, and profileName. Note that 'Profile name' refers to the name configured on the Channel's page during MS Teams setup.
curl --location 'https://cloud.yellow.ai/api/integrations-worker/integrationCDPUserSync/bulkUserCreate/botframework/yellow_alpha6?botId=x1632218421575&isChannel=true' \ --header 'x-api-key: 67dYPpyWiGXjppnWMHLJQJB6sWsitkWwg0FjCqQY' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer sddd' \ --data '{ "profileName": "yellow_alpha6" }'

Test MS Teams chatbot

Once you have created an app and connected it to the Yellow.AI platform, you need to test the bot to verify whether the bot is able to respond to user messages on MS Teams app.

To test your bot on MS Teams, follow these steps:

  1. Open the MS Teams app on your mobile device or on website.

  2. Navigate to Apps and search for the app name under Apps. Select the app that you have created and click Open.

  3. Go to Chats and start the conversation with the bot. Make sure you have already created an intent and added the utterances to trigger the corresponding flow in your MS Teams chatbot.

  4. If a flow is configured for agent reply using the raise ticket node to start a conversation with an agent, it initiates a conversation with the agent. Once a conversation is initiated, the user can talk to the agent.

  5. To view the entire conversation between the live agent and user, navigate to the Inbox module in the platform and select Bot messages in the My Chats section.

When the conversation between the agent and user ends, the bot takes the conversation forward with the user.