Webex Teams Rest Api



After watching this video, you will be able to better understand how to leverage REST API to automate processes. This is an exclusive video not found in any Cisco Collaboration class! The main topics include POSTMAN, REST API, and WebEx Teams. The following features are NOT implemented: Message Attachments, Room moderation, People LastActivity & Status and Pagination, as well as Teams, Automatic Invitations (if non Webex Teams users are added to rooms) and Administration APIs. Membership APIs that accept both emails and personIds currently only work with personIds in the emulator. 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.

Latest version

Released:

A Flask based Webex Teams chat bot.

Project description

This package makes creating Webex Teams bots in Python super simple.

This package is based on the previous ciscosparkbot project. This version will both move to new Webex Teams branding as well as add new functionality. If you've used ciscosparkbot you will find this package very similar and familiar.

If you don't already have a Webex Teams account, go ahead and register for one. They are free.

  1. You'll need to start by adding your bot to the Webex Teams website.

  2. Click Create a New App

  3. Click Create a Bot.

  4. Fill out all the details about your bot. You'll need to set a name, username, icon (either upload one or choose a sample), and provide a description.

  5. Click Add Bot.

  6. On the Congratulations screen, make sure to copy the Bot's Access Token, you will need this in a second.

Python 3.6+ is recommended. Artrage for mac free download. Python 2.7 should also work.

  1. Create a virtualenv and install the module

  1. The easiest way to use this module is to set a few environment variables

    Note: See ngrok for details on setting up an easy HTTP tunnel for development.

  2. A basic bot requires very little code to get going.

  3. A sample script that shows more advanced bot features and customization is also provided in the repo.

Advanced Options

Changing the Help Message

  1. Although 'set_greeting' has existed for a while now, you may mostly like the internal greeting mechanism, but only want to change the help banner itself. You can do that with the 'set_help_message' command like this:

Working with events other than created messages

  1. By default, the bot will configure the webhook to listen for messages:created events. This behavior can be changed using the 'webhook_resource' and 'webhook_event' parameters. So, for example, if you wish for the bot to monitor any changes to a room's membership list, you would instanciate the bot like this:

    You also need a way to catch anything other than 'messages', which is the only thing handled entirely inside the bot framework. Continuing the example of monitoring for membership changes in a room, you would also need to add a 'command' to catch the membership events. You would use the following to do so:

    The first argument, 'memberships', tells the bot to look for resources of the type 'memberships', the second argument '*' instructs the bot that this is not something that should be included in the internal 'help' command, and the third command is the function to execute to handle the membership creation.

  2. The bot can also be configured to listen for multiple different events. So, for example, if you wish for the bot to monitor not only new messages in a room, but also any card actions in a room, you would instanciate the bot like this:

    Once again, You also need a way to catch anything other than 'messages'. Continuing the example of monitoring card actions, you would also need to add a 'command' to catch the card actions. You would use the following to do so:

    The first argument, 'attachmentActions', tells the bot to look for resources of the type 'attachmentActions', the second argument '*' instructs the bot that this is not something that should be included in the internal 'help' command, and the third command is the function to execute to handle the card action.

Creating arbitrary HTTP Endpoints/URLs

  1. You can also add a new path to Flask by using the 'add_new_url' command. You can use this so that the bot can handle things other than Webex Teams Webhooks. For example, if you wanted to receive other webhooks to the '/webhooks' path, you would use this:The first argument, '/webhooks', represents the URL path to listen for, the second argument represents the Flask endpoint, and the third command is the function to execute to handle GET, PUT, or POST actions.

Limiting Who Can Interact with the Bot

  1. By default the bot will reply to any Webex Teams user who talks with it. But you may want to setup a Bot that only talks to 'approved users'.

  2. Start by creating a list of email addresses of your approved users.

  3. Now when creating the bot object, simply add the approved_users parameter.

  4. Now if a users NOT listed in the approved_users list attempts to communicate with the bot, the message will be ignored and a notification is logged.

ngrok will make easy for you to develop your code with a live bot.

You can find installation instructions here: https://ngrok.com/download

Webex Teams Rest Api Download

  1. After you've installed ngrok, in another window start the service

  2. You should see a screen that looks like this:

  3. Make sure and update your environment with this url:

  4. Now launch your bot!!

Local Development

If you have an idea for a feature you would like to see, we gladly accept pull requests. To get started developing, simply run the following.

Linting

We use flake 8 to lint our code. Please keep the repository clean by running:

Testing

Tests are located in the tests directory.

To run the tests in the tests folder, you can run the following commandfrom the project root.

This will generate a code coverage report in a directory called htmlcov

The initial packaging of the original ciscosparkbot project was done by Kevin Corbin.

This package was created withCookiecutter and theaudreyr/cookiecutter-pypackageproject template.

0.1.0 (2018-11-10)

  • First release on PyPI.

0.1.1 (2018-11-10)

  • Second release on PyPI.

Webex Calling Api

0.1.2 (2018-11-11)

  • Added feature to easily change the bot greeting
  • Updated Example bot sample.py with better documentation and examples
  • Allow Response() objects to specify alternative roomId for reply

0.1.2.1 (2018-11-11)

  • Updated README with a very simple bot example with a link to the full sample.py script

0.1.3.0 (2019-10-03)

  • Adding new features for cards and membership management (Thanks @joshand!)
Cisco

0.1.4.0 (2020-02-15)

  • Added feature to limit who can talk to the bot.

0.1.4.1 && 0.1.4.2 (2020-02-20)

Webex teams rest api
  • Bug fix for when a Bots name is in a mention and causes command confusion

Release historyRelease notifications | RSS feed

0.1.4.2

0.1.4.1

0.1.4.0

0.1.3.0

Webex teams rest api download

0.1.2.1

0.1.2

0.1.2a0 pre-release

0.1.1

Webex Meetings Api

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for webexteamsbot, version 0.1.4.2
Filename, sizeFile typePython versionUpload dateHashes
Filename, size webexteamsbot-0.1.4.2-py2.py3-none-any.whl (13.0 kB) File type Wheel Python version py2.py3 Upload dateHashes
Filename, size webexteamsbot-0.1.4.2.tar.gz (23.7 kB) File type Source Python version None Upload dateHashes
Close

Hashes for webexteamsbot-0.1.4.2-py2.py3-none-any.whl

Hashes for webexteamsbot-0.1.4.2-py2.py3-none-any.whl
AlgorithmHash digest
SHA25600cea89864bd1743baf1cb14d5f02b8ccdbf42a6854f5dac927e31b081974e7d
MD5f0e19320370b139f6e991f4840181171
BLAKE2-256f9220ef4c4c03f662892080c73b3ec2f5210502a94c7efe23c5eecbf5124f0c2
Close

Hashes for webexteamsbot-0.1.4.2.tar.gz

Hashes for webexteamsbot-0.1.4.2.tar.gz
AlgorithmHash digest
SHA2569cd8f49612daeafbd55650aa54033ea52ff5832c874cac1b1257f1a51952083d
MD52630b623347af2ba067ad3cbee9803a1
BLAKE2-2563382f8d9c8d0fb75d44dd324198d8e1088efd45de4231b70ef079816f94b40cf
[ library, mit, program, web ] [ Propose Tags ]

Please see the README on Github at https://github.com/nshimaza/webex-teams-api#readme

[Skip to Readme]
Versions [faq]0.2.0.0, 0.2.0.1
Change logChangeLog.md
Dependenciesaeson, attoparsec, base (>=4.7 && <5), bitset-word8, bytestring, conduit, data-default, http-conduit, network-uri, optparse-applicative, text, utf8-string, webex-teams-api [details]
LicenseMIT
Copyright2017-2020 Naoto Shimazaki
AuthorNaoto Shimazaki
MaintainerNaoto.Shimazaki@gmail.com
CategoryWeb
Home page https://github.com/nshimaza/webex-teams-api#readme
Bug tracker https://github.com/nshimaza/webex-teams-api/issues
Source repohead: git clone https://github.com/nshimaza/webex-teams-api
Uploadedby nshimaza at 2020-07-29T15:12:25Z
DistributionsLTSHaskell:0.2.0.1, NixOS:0.2.0.1, Stackage:0.2.0.1
Executableswebex-teams-api-exe
Downloads865 total (2 in the last 30 days)
Rating(no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status
Docs available [build log]
Last success reported on 2020-07-29 [all 1 reports]

Modules

[Index] [Quick Jump]

  • Network
    • Network.CiscoSpark
    • Network.WebexTeams

Downloads

  • webex-teams-api-0.2.0.1.tar.gz [browse] (Cabal source package)
  • Package description (as included in the package)

Maintainer's Corner

Webex Teams Rest Api

For package maintainers and hackage trustees

Readme for webex-teams-api-0.2.0.1

[back to package description]