4/11/2023 0 Comments Webex teams api![]() You’d want to make sure that the bot behaves properly in circumstances where there are no people from your company, some people from your company, no people from other companies and some people from other companies. For example if you send your bot a message like “who from my company is in this room”, you might want it to list people from your company but also be sure that it skips people from other companies. Imagine your bot needs to have a particular response in certain specific, potentially complex, circumstances. Handy for working offline, right? But once you get used to this, you may start to realize that running in this mode simplifies your development motion even when you DO have an internet connection. Assume you are now able to send commands to your bot via Postman and see the Webex API requests that your bot makes in response, all offline. We’ve glossed over a few things here, but we’ll get back to it. ![]() Once you can can send a message to your bot via the emulator, you can open up your favorite editor or debugger, and you can start stepping through your bot’s responses to these commands, building and debugging responses to these inputs, all without an internet connection. The emulator also supports the webhooks API so if you configure your bot to talk to your locally running instance of the emulator, your bot will get notified when it is added to a space or when a message is sent to it. Once the emulator is up and running you can use a tool like Postman to send requests to the Webex API Emulator to do things like create spaces, add a user (or bot) to a space, or post a message to the space. Let’s start making those wishes come true by dealing with the last wish first, the idea of doing bot development when you are offline. Think of it as your own, local, common identity server. This file, which is editable by you, allows you to create “authorization tokens” and “personIds” for your bot, your tester and any other “people” that might be added to spaces as part of your tests. It loads a tokens.json configuration file that tells it about the users that can interact with it. The emulator is a simple node.js project which you can download from GitHub and run locally. If so, I’m happy to let you know that the Webex API Emulator, originally created by Stève Sfartz, API Evangelist at Cisco DevNet, can help make your wishes come true. Do you develop bots for Cisco Webex Teams (formerly Cisco Spark)? Do you ever wish that there was a way to create a set of regression tests to ensure that your bot behaves consistently given the same input? Or maybe you wish that there was a way to speed up your iterative development/debug process when you are working on a bot response to a complex set of input? Or perhaps, you just wished you could do some bot development work when you were in a place that didn’t have good internet connectivity?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |