Skip to content

Releases: WebexCommunity/WebexPythonSDK

WebexPythonSDK 2.0 Documentation

08 Aug 17:21
e417de1
Compare
Choose a tag to compare

Documentation for the newly named package webexpythonsdk is now hosted on github pages at https://webexcommunity.github.io/WebexPythonSDK/

What's Changed

Full Changelog: v2.0.0...v2.0.1

webexpythonsdk v2.0.0 Now Released!

03 Aug 02:05
2de9432
Compare
Choose a tag to compare

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

07 Jun 15:59
40acce8
Compare
Choose a tag to compare

This release is a hotfix that merges Pull request #175 into the main branch.

What's Changed

New Contributors

Full Changelog: v1.6...v1.6.1

The Catch-Up Release

13 Jul 15:23
49a0a0d
Compare
Choose a tag to compare

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

09 Jul 19:00
1cea422
Compare
Choose a tag to compare

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

07 Jul 20:35
704904a
Compare
Choose a tag to compare

Version 1.4 adds support for the Admin Audit Events API; however, you should note that pagination is currently broken ☹️ on responses from the /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

13 Apr 13:50
c0cdea6
Compare
Choose a tag to compare

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

20 Sep 17:57
b9ac306
Compare
Choose a tag to compare

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

03 Jan 06:33
5c7e75d
Compare
Choose a tag to compare

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 - The requests.Response object returned from the API call.
  • request - The requests.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

09 Sep 06:59
8dffb0c
Compare
Choose a tag to compare

The new WebexTeamsDateTime functionality had introduced a minor compatibility bug with Python v2. We squished it. 🐜💀