Releases: WebexCommunity/WebexPythonSDK
WebexPythonSDK 2.0 Documentation
Documentation for the newly named package webexpythonsdk
is now hosted on github pages at https://webexcommunity.github.io/WebexPythonSDK/
What's Changed
- chore(docs): use rtd theme by @adamweeks in #238
- docs: update to gh-pages links by @adamweeks in #239
Full Changelog: v2.0.0...v2.0.1
webexpythonsdk v2.0.0 Now Released!
Welcome to the new webexpythonsdk
library! The latest release removes support for Python v2 and is compatible with Python v3.10+. The new Webex Python SDK replaces the previous webexteamssdk
; and with the exception of the Python version support and the name change, the two libraries are functionally equivalent. The new library is the recommended choice for new projects, and webexteamssdk
users are encouraged to migrate.
Hotfix
This release is a hotfix that merges Pull request #175 into the main branch.
What's Changed
- Fix for #147 by @fbradyirl in #157
- Bump pygments from 2.6.1 to 2.7.4 by @dependabot in #158
- Fix type check in
update
by @mallamanis in #150 - Added option to disable ssl cert verification by @sQu4rks in #142
- Update Cards Handling to check correct attribute for instance of AdaptiveCards (solves #140) by @sQu4rks in #141
- fixing OpenUrl action by @craigers521 in #175
New Contributors
- @fbradyirl made their first contribution in #157
- @dependabot made their first contribution in #158
- @mallamanis made their first contribution in #150
- @craigers521 made their first contribution in #175
Full Changelog: v1.6...v1.6.1
The Catch-Up Release
In v1.6, we have updated all of the currently wrapped and supported Webex Teams API endpoints and closed out all existing issues that users opened on the v1.x releases. The library should now be up-to-date in supporting the Webex Teams APIs documented at developer.webex.com. It is not yet up-to-date in supporting the newer and broader Webex Meetings, Calling, and Devices APIs. We are tracking adding these additional API endpoints in issue #113, and we will work to add full support for all of the published Webex APIs in v2.x of the library.
With release v1.6, we are wrapping up active development on the v1.x release and shifting our focus to the next major release v2!
Breaking Change(s)
We have introduced one (1) breaking change in v1.6:
-
We have changed the function signature (parameter names) for the
WebexTeamsAPI.guest_issuer.create()
method to align it with the developer documentation at developer.webex.com.Previous method definition:
def create(self, subject, displayName, issuerToken, expiration, secret): ...
def create(self, sub, name, iss, exp, secret): ...
Accessible Webex Tracking IDs & Custom User-Agent Header
Version 1.5 adds several minor backend improvements, including:
-
Webex Tracking IDs are now prominently displayed for all API errors and warnings.
Example Error Message:
ApiError: [401] Unauthorized - The request requires a valid access token set in the Authorization request header. [Tracking ID: ROUTER_5F05F384-D9E9-01BB-00FF-4B0C804F00FF]
You can also access the Tracking IDs via the
tracking_id
attribute available on the raised exception and warning objects.api = webexteamssdk.WebexTeamsAPI(access_token="abc") try: api.people.me() except webexteamssdk.ApiError as e: print(e.tracking_id)
-
The webexteamssdk library now sends a custom User-Agent header (inspired by PIP's User-Agent header).
Example User-Agent Header:
webexteamssdk/1.5 {"implementation": {"name": "CPython", "version": "3.7.8"}, "distro": {"name": "macOS", "version": "10.15.5"}, "system": {"name": "Darwin", "release": "19.5.0"}, "cpu": "x86_64"}
-
Minor package and PEP8 improvements.
Add support for the Admin Audit Events API
Version 1.4 adds support for the Admin Audit Events API; however, you should note that pagination is currently broken /v1/adminAudit/events
API endpoint. Hopefully, the Developer Support Team will get this fixed quickly.
Also in this release we...
- Squashed a timezone info bug that was affecting Python v2.7 and 3.5
Official Support for the Attachment Actions API
This minor update adds official support for adding attachments to messages via WebexTeamsAPI.messages.create()
thanks to @bradh11, @jianchen2580, @zhanto97, and @jwa1 🙌!
@jpjpjp has created an excellent Webex Teams bot example that demonstrates using webhooks, Adaptive Cards, and response actions! 😎
Python Adaptive Cards Beta
This release includes a beta of @sQu4rks Python Adaptive Cards, but please do not get too attached using this functionality directly from the Webex Teams SDK as we will be migrating this functionality to leverage @sQu4rks newer (and independently maintained) pyadaptivecards library.
Proxy Support
Thanks to @sQu4rks 😎, webexteamssdk
now (offically) supports configuration and use of an HTTP/HTTPS proxy! Just past a dictionary with the proxy configuration when creating your WebexTeamsAPI
connection object, and you are good to go. 👊
>>> from webexteamssdk import WebexTeamsAPI
>>> proxy = {'https': 'http://<proxy_ip>:<proxy_port>'}
>>> api = WebexTeamsAPI(access_token=<your_access_token>, proxies=proxy)
Check out the requests documentation on Proxies for details on what should be in the proxies dictionary.
Simplify ApiError Messages
ApiError
messages are now shorter, more insightful, and easier to inspect. 🙌
We have simplified the default string interpretation of the ApiError
messages. The simplified messages will use the message
attribute of the returned JSON (if present) to provide more insight as to why the request failed and will default to the generic error descriptions from the API docs if a message
attribute is not available.
Example of the New Message Format:
ApiError: [400] Bad Request - Message destination could not be determined. Provide only one destination in the roomId, toPersonEmail, or toPersonId field
The ApiError
exceptions now have several attributes exposed for easier inspection:
response
- Therequests.Response
object returned from the API call.request
- Therequests.PreparedRequest
used to submit the API request.status_code
- The HTTP status code from the API response.status
- The HTTP status from the API response.details
- The parsed JSON details from the API response.message
- The error message from the parsed API response.description
- A description of the HTTP Response Code from the API docs.
To inspect an error, simply catch it in a try block and access the above attributes on the caught error:
from webexteamssdk import ApiError, WebexTeamsAPI
api = WebexTeamsAPI()
try:
api.messages.create()
except ApiError as error:
print(error.message)
See ApiError
in the API Docs for more details.
This enhancement addresses enhancement request #62 and resolves 🐛 #68.
Python2 compatibility bug - fixed
The new WebexTeamsDateTime
functionality had introduced a minor compatibility bug with Python v2. We squished it. 🐜💀