Work with the Webex APIs in native Python!
MIT License
Bot releases are hidden (Show)
Published by cmlccie over 7 years ago
The Python v2 & v3 compatibility changes made the v0.6 release introduced an issue where non-unicode strings would fail the API method's type-checking assertions. This issue slipped by the test suite because the test suite had been simultaneously updated to use the Python-Future module (which as used ensured unicode type consistency in both Python v2 & v3).
We have removed the Python-Future use from the test suite (so we are testing with more 'native' Python v2 and v3 code), and corrected the issue with the package's type-checking assertions.
Sorry for any headaches you might have had over the weekend (since the v0.6 package was released), upgrading to v0.6.1 should correct this issue.
As always, please do open an issue if you are experiencing any problems or challenges working with the ciscosparkapi package.
-Thank You!
Published by cmlccie over 7 years ago
v0.6 has several cool things in it...
six
package dependency has been removed).displayName
and email
parameter when searching for people (you can now list
all of the people in your organization, by calling the people.list()
method without providing any parameters).Makefile
and requirements.txt
updates, contributor docs are coming soon).Published by cmlccie over 7 years ago
ciscosparkapi now has a full automated testing suite (using py.test)!! All on-line testable user-facing methods (API calls) have been thoroughly worked through their paces. :-) (issue #4)
The test suite uses a moderate array of py.text fixtures to align object and API dependencies, order test execution, cache results, and optimize API calls. All of this speeds up testing time by minimizing the number of API requests that must be completed to finish a test run. ...and the tests clean-up after themselves as well (though I still recommend using a dedicated test account when running the tests + it will need admin privileges).
Caught and fixed a couple of bugs in the process.
There are a couple of Cisco Spark APIs that are not responding properly (according to the API docs). I will investigate these and re-enable these tests shortly.
Published by cmlccie over 7 years ago
#20 Added wrappers for the new Admin API Endpoints:
Squashed some Bugs:
Published by cmlccie almost 8 years ago
Updated package and file copyright references to specify ‘Cisco
Systems, Inc.’ as per recommendations from Cisco legal.
Published by cmlccie about 8 years ago
Thank you @brbester for the enhancement request and sharing your code on how you had solved this previously!
When creating a new message, the files
argument now accepts either a valid HTTP/HTTPS Internet URL or a path to a local file that should be uploaded when the message is created.
Note that the files
argument only accepts a list containing a single item (a string containing either a URL or a local file path). This is a Spark API limitation that may be lifted at a future date. We have implemented method consistent with the Spark API to provide for backwards compatibility if/when this enhancement is made in the future. This way, when Spark opens up support for attaching multiple files on a single message (and we update the package to support that capability), we will not change the method's API and break calls to this method from existing code leveraging the package.
from ciscosparkapi import CiscoSparkAPI
api = CiscoSparkAPI()
DEMO_ROOM_NAME = "ciscosparkapi Test Room"
DEMO_PEOPLE = ["[email protected]", "[email protected]"]
DEMO_TEXT = u"Cisco Spark rocks! \ud83d\ude0e"
DEMO_FILE_URL = "https://developer.ciscospark.com/images/[email protected]"
MARKDOWN_TEXT = "**This was uploaded from a local file!**"
DEMO_LOCAL_FILE = "picture.jpg"
# Create a new test room
demo_room = api.rooms.create(DEMO_ROOM_NAME)
# Add people to the room
for person_email in DEMO_PEOPLE:
api.memberships.create(test_room.id, personEmail=person_email)
# Post a plain-text message to the room, with an attachment from an Internet URL
message1 = api.messages.create(test_room.id, text=DEMO_TEXT, files=[DEMO_FILE_URL])
print(message1)
# Post a markdown-message to the room, with an attachment uploaded from a local file
message2 = api.messages.create(test_room.id, markdown=MARKDOWN_TEXT, files=[DEMO_LOCAL_FILE])
print(message2)
Published by cmlccie about 8 years ago
CiscoSparkAPI.people.list()
) returns an empty list.CiscoSparkAPI.webhooks.update()
to fail.Published by cmlccie about 8 years ago
The package now supports Python v2 and v3! Please upgrade to this release to test the package with your v2 or v3 code, and report any issues via the issues page.
Upgrade also includes:
Published by cmlccie about 8 years ago
Added a patch to workaround issue #7, where the Cisco Spark cloud is returning an errant 'max=null' query parameter in the next URLs when paging requests where a max= parameter was not specified.
Fixed bug #8, where the files=[] parameter of the CiscoSparkAPI.messages.create() method was not correctly being treated as an list.
Published by cmlccie about 8 years ago
This package is now available on PyPI!
$ pip install ciscosparkapi
v0.1.1 - Fixed an issue where the API sub-package (ciscosparkapi.api) wasn't included in the source distribution package.
Published by cmlccie about 8 years ago
Beta release imminent.
We are preparing to release the first beta for this package. Please test out the package for your use cases, and raise issues for any problems you encounter. Also, PLEASE create new issues to provide feedback and foster discussion on the package API structure (names, method calls and etc.). The package APIs are still subject to change, and I would like to get these nailed down before we release v1 for the package.