DEV Community

Cover image for Webex Teams Status to MQTT in python
withchristopher
withchristopher

Posted on

1

Webex Teams Status to MQTT in python

The Cisco Webex Teams API service has a neat SDK for calling methods from your personal account. One of these methods is to fetch your personal status (eg. active, DoNotDisturb, presenting, OnCall). This post will look at the API and pass the 'status' to any service (eg. MQTT subscriber/publisher).

Write 2 files called status.py and config.py:

For status.py :

Importing the packages below:
Alt Text

Write 3 functions (including main) and then 'dunder' main to run main function:
Alt Text

For config.py:

Specify your Webex API token (create Webex Teams account, go to developer.cisco.com for toke). Update IP address and port of MQTT:

Alt Text

Optional: change the time.sleep(5) to any number in seconds between API request.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free β†’

πŸ‘‹ Kindness is contagious

Please leave a ❀️ or a friendly comment on this post if you found it helpful!

Okay