Up-to-Date | Cleaner & Clearer Than Ever
All of the API wrappers and data models have been reviewed and updated to match the latest Cisco Spark API capabilities. -and- We have completed a significant internal restructuring to improve all of the API wrappers:
-
All API methods that accept parameters and post-data have been updated to consistently accept optional (
**request_parameters
) keyword arguments. So, if Cisco releases an API update tomorrow with some new awesome parameter... You can go ahead and use it. We'll update the code later so that it shows up in your IDE as soon as we can. -
New WebhookEvent - Webhook posts to your bot or automation can now be modeled via a new
WebhookEvent
. Just pass the JSON body that Spark posts to your web service to theWebhookEvent()
initializer and you can use native dot-syntax to access all of the attributes. -
Exceptions - some changes to what exceptions are raised...
- TypeErrors - If you happen to pass an incorrectly typed parameter to one of the API methods or object initializers, the package will now raise a more appropriate and informative
TypeError
rather than anAssertionError
. - ValueErrors - If you pass an incorrect value... You guessed it
ValueError
.
- TypeErrors - If you happen to pass an incorrectly typed parameter to one of the API methods or object initializers, the package will now raise a more appropriate and informative
Exception handling should be very straightforward now. The only exception that you should have to catch and handle at runtime should be the SparkApiError
's, which are returned when Cisco Spark responds with an error code. By the way, these were recently updated to show you the full request and response body, when an error occurs. Any other errors should show up and be addressed when you are writing and debugging your code.
Please open an issue if you experience any issues with the package. We have tested it extensively so hopefully you shouldn't! ...but the issue log is there just in case. 🤞 😎
-Thank You!