Project Name

Successfully Integrated Microsoft Teams Chatbot with external API Services

Industry
EdTech
Technology
NodeJS, Microsoft Bot framework, ExpressJS, Google API Library

Overview

Our client belongs to an EdTech organization that provides Learning Experience Solutions for unified discovery, knowledge management, and personalized learning solutions. They were looking for a solution to integrate the MS Teams Chatbot with external API Services for the right Learning Experience Platform. Also, they were looking for a solution to fetch the available slots of the users from Google and Microsoft calendars.

chatbot-banner-sider

Challenges

Frame 73
  • Facing issues in configuring the chatbot commands.
  • Issue in integrating the in-house APIs to display the data.
  • It was difficult for them to create calendar events as per the available slots of the user.

Our Solution

Development Process:

Creating the manifest.json File:

The development process of crafting a chatbot for integration within Microsoft Teams initiates with the creation of a manifest.json file. This pivotal file serves as a foundational component encompassing configurations essential for the integration of APIs and visibility of the custom chatbot commands. Once the manifest.json file is configured with the necessary details, the next step involves uploading the application into Microsoft Teams.

Screenshot of chat-bot commands in the manifest.json file

Case study image

Azure Directory Configuration with Microsoft Teams

To integrate and call the in-house APIs from the chatbot we have to configure the endpoints at some place, that is where the Azure portal comes into the picture. On this portal, we create our project and in the configuration of it, we provide the endpoint to our codebase. Now, when we type in a command in the chatbot, it sends a request to the Azure portal which further triggers the endpoint of the in-house APIs and finally returns the data to our chatbot integration code where we receive the control to make further operations.

Flow chart

case study image

User Authentication Flow

Flow diagram illustrating how users authenticate within MS Teams to access the chatbot's functionalities securely.

case study image

Code Snippet

code-snippet

Additional Features of Chatbot App Integration

  • Calendar Integration Flow: We successfully implemented a flow to directly link a user's calendar to the chatbot instantly. Our team incorporated the adaptive cards for better user interaction and direct authentication checks. Ksolves has successfully linked the Google and Microsoft calendars, handling the authentication, and securing the store access tokens. All these things are mentioned in a proper way that is mentioned below: The Calendar Integration Flow for the chatbot within Microsoft Teams involves several key steps to link a user's calendar to the bot seamlessly.
  • Chatbot Command Initiation: The user triggers a specific command within the chatbot interface to link their calendar with the bot.
  • Command Verification: The chatbot verifies the received command, ensuring its validity and relevance for calendar integration.
  • User Authentication Check: The Microsoft bot framework checks if the user is authenticated or not for calendar linking. If not authenticated, the bot initiates the authentication process.
  • Authentication and Calendar Linking: If the user is authenticated but has not linked their calendar, an adaptive card is displayed, providing an option to link their calendar. If the calendar is already linked, a message is shown indicating that the user's calendar is already connected.
  • Linking Process: When the user clicks on the "Link my Calendar" button on the adaptive card, the bot redirects the user to the respective authentication page (Google or Outlook) using the APIs configured previously.
  • Authentication with Google or Outlook: The user authenticates their Google or Outlook account using their credentials. The respective API generates an access token upon successful authentication.
  • Token Storage and Confirmation: After authentication, the user is redirected to a predefined redirect URL within the bot's codebase. The generated access token is securely stored in the bots database, associating it with the user's profile. A confirmation message is displayed to the user within the chatbot, notifying them that their calendar is successfully linked, granting access for further operations.
  • User Interaction Post Calendar Linking: Post successful linking, the user can now interact with the chatbot for various calendar-related functionalities or operations.

    This flow demonstrates the process by which the chatbot facilitates authentication, calendar linking, and access token storage, providing users with a streamlined experience for integrating their calendars within the Microsoft Teams environment.
additional-features

Conclusion

Hence, we can conclude that our team has successfully completed the integration of custom chatbot commands which returns the data as per the operation performed. We were successfully able to link the Google and Microsoft calendars to create an event based on the chatbot command only. Even worked on API integration and methods that are hosted by the Microsoft bot framework.

Streamline Your Business Operations With Our
Node JS Customized Chatbot Solutions!