Creating a Webex Teams Chatbot with almost no coding
Have you found yourself performing basic IT tasks, such as monitoring a dashboard, repeatedly? Are you one of the many engineers who want to automate these activities, but are slightly intimidated by the code you’ll need to learn in order to accomplish this?
Bots can help with alerting you when a certain event takes place, such as a high-priority incident on your network, by leveraging APIs, but many engineers feel they don’t yet have the programming skills needed to create a bot.
At Cisco, there’s a simplified way of creating a bot that listens out for alerts and responds accordingly. Through integrating with a flow-based tool such as Node-RED, you can do this with minimal programming, making it ideal for first timers aiming to gain more experience in leveraging Bots.
Here you can find a lab guide that walks you through step-by-step the process of creating a bot that retrieves information from an external source, extracts the information of interest and then posts it in Webex Teams. And believe it or not, you could run through the entire lab in about an hour or so.
What is included in the lab guide?
Since this guide is designed for absolute beginners, the complexity is kept to a minimum. There are explanations from the very beginning, such as how to set up an account on IBM Cloud and how to create a Node-RED instance once you’re signed in. The bot created in the guide retrieves external information by getting a joke from an online joke database, but this can easily be substituted with any external source that exposes the appropriate APIs.
The lab guide briefly explains the following concepts:
- Creating an API
- Creating a webhook
- Creating a Bot
- Using Webex Teams APIs to post messages
- Using other APIs to retrieve external information and push that info to Webex Teams
How does it work?
The idea is as follows:
- You create a Bot
- You create an API on Node-RED for Webex Teams to POST to.
- You create a webhook that makes Webex Teams POST to that API when the bot receives a message.
- When the bot receives a message and Webex Teams POSTs to the API, a flow is triggered. This flow does the following:
- Make an API call to get a joke from the icanhazdadjoke database (https://icanhazdadjoke.com/)
- Extract the most important information from the API response: the joke itself
- POST that joke to Webex Teams from the Bot account
The concepts in this lab guide are kept super simple to break down the barriers to entry with automation and programmability. Once you’re comfortable with how this flow works, there are many ways you can extend its capabilities. Maybe instead of retrieving a joke, you could retrieve network health stats and post them to Webex Teams instead? Or perhaps it could retrieve information about how busy the offices are by integrating with DNA Spaces (though by this point, you may need to leverage a more advanced programming tool)? The possibilities really are endless!
You can find more examples of Webex integrations here
you can follow a dedicated learning track to boost Webex API programming skills hereTags: