January 2019
Beginner to intermediate
776 pages
19h 58m
English
Execute the below recipe to create a new room and post a photo to it.
Listing 12.7 gives a simple program that connects to the Cisco Spark cloud, creates a room, shares a textual message as well as a photo as follows:
#!/usr/bin/env python # Python Network Programming Cookbook, Second Edition -- Chapter - 12 # This program is optimized for Python 3.5.2 and Python 2.7.12. # It may run on any other version with/without modifications. from ciscosparkapi import CiscoSparkAPI api = CiscoSparkAPI() # Create a new demo room demo_room = api.rooms.create('ciscosparkapi Demonstration') print('Successfully Created the Room') # Post a message to the new room, and upload an image from a web url. api.messages.create(demo_room.id, text="Welcome ...Read now
Unlock full access