A few months back I had been working on network automation and APIs via DevNet for different technologies and getting certified. I was spending some time exploring Webex Teams, bots, and thinking of use cases for integration. There are some really cool items that can be done for integrations and I began working on some of my custom home monitoring tools, like my garage opener. A Great benefit of using Webex Teams for this was that I didn’t need a separate app on my phone for this.
The Webex REST API has a new host name: webexapis.com. The new host name works just like the old one. All API resources and endpoints from api.ciscospark.com are now available at the new host name. Read more about the change in our blog: Introducing the new webexapis.com. Webex REST API Basics While working with the Webex REST API is easy, there are a few things we standardize on throughout the API, such as pagination of long result sets or HTTP response codes. To automate tasks, custom applications use the Webex Teams REST API. The 'Webex Teams REST API' takes you to the following link which is broken: https://developer. Connect and share knowledge within a single location that is structured and easy to search. How do you login via the WebEx URL REST API? The new Webex Meetings REST API enables seamless integration of Cisco Webex Meetings into your websites, apps, and services. Schedule meetings, invite meeting attendees, update preferences, and more.
Then the pandemic happened and life changed – constant news reinforcing our primal fear instincts; groceries in scant supply; schooling issues for our children. I wanted to do something for our team to help keep spirits high.
Using the Webex teams SDK
I realized it would be really easy to create a very simple bot that had a very simple purpose, one positive message for people, every day. It was to be a Webex Teams space without a lot of discussion, just a positive message every day. Using the Webex Teams SDK and a handy Raspberry Pi, this was very easy to get going.
I quickly set up a Webex Teams bot on that Raspberry Pi, created a space, and told a few people about it. A few people invited some other people. Pretty soon we had 50 people and it was officially a “thing”. So I had to take my minimum viable project and improve some of the quotes in the list, which had been scraped from a repository on Github, and was… a good start. It had some cleanup to be done.
This portion of theDailyPositive bot was beneficial to me. While it was a personal project that I did in off hours, picking out good, uplifiting quotes was really positive for keeping mental sanity during this time.
Over the course of four months this slowly expanded, reaching about 180 employees as of August 2020. But I had begun to experience a few operational challenges in sustaining this on my Raspberry Pi, notably a few hangs (likely due to a few other things I had running on it), and during some network upgrades (to support my new office layouts with kids at home), the Raspberry Pi had a few days where it was down. So whether the Pi just got tired, or had lost connection, there were a few times that the daily positive just did not run. I wasn’t feeling so positive about that.
Time to migrate this to the cloud
As I was doing some side integration work with creating some cloud capabilities for Webex Teams use cases, I had already poked in AWS to get some Teams messaging working. I decided for this project to use Google cloud platform so that I could gain exposure to that platform, for which I had another use case (involving Webex Teams).
The 2 key GCP functions to bring this to fruition were the Cloud Scheduler (for Cron like scheduling), and cloud functions. Tying these two items together allowed the function to run on a scheduled basis, similar to how my existing setup worked.
While the migration was pretty straight forward, as with everything, there were some challenges. These were initially ported into a cloud function in GCP. Some of the initial work done on the raspberry Pi included using the requests library and the Webex teams SDK. These weren’t available in GCP (at the time of writing), so I had to use standard HTTP posts using http library. This was not difficult to do, but required some thought. In addition, the cloud scheduler needed some IAM privileges to access the function. After working through those two items, I had a development room where I validated functionality, and after a few days migrated it to production.
The updated repo for the daily positive is here, containing both the Raspberry Pi code, and the gcp software. https://github.com/will0129/thedailypositive
Webex Teams Rest Api Tutorial
A nice aspect of this, is the function is extremely lightweight and, with it only running once a day, doesn’t even scratch the surface on pricing. So this makes this migration a very affordable way to ensure that the daily positive can bring a bit of good news … daily … regardless of the state of my Raspberry Pi.
How do I get information on the Webex APIs?
Webex Calling Api
What does API stand for?
Where can I find API documentation?
What is the API developer site?
Webex Api Integration
API is an acronym for Application Programming Interface.
Webex Teams Api
- For information on Webex Developer XML API, see: https://developer.cisco.com/site/webex-developer/develop-test/xml-api/overview/
- For information on Webex Developer URL API, see: https://developer.cisco.com/site/webex-developer/develop-test/url-api/overview/
- For information on Webex Developer REST API, see: https://developer.webex.com/docs/api/getting-started