QuestionQ173

Cisco Platforms

Drag the code below into the missing boxes to create a new Cisco Webex space and attach the previously configured bot named sampleBot. Not every option is used.

Drag & Drop
roomId
rooms
memberships
member
userId
id
import requests as re
import json

token = '<< personal token >>'
auth = 'Bearer {}'.format (token)
header = {'Authorization': auth}
room_name = "Yet_another_room"
body = {'title': room_name}
create_room_url = 'https://webexapis.com/v1/'
add_membership_url = 'https://webexapis.com/v1/'

request = re.request (method= 'POST', url=create_room_url, headers=header, data=body)
resp = json.loads (request.text) ['']
body = {'': resp, 'personEmail': 'sampleBot@webex.bot'}
request = re.request (method = 'POST', url=add_membership_url, headers=header, data=body)
Explanation

Webex uses the /rooms resource to create a space, returning the created space's id. A person or bot is invited through the /memberships resource; its request body identifies the target space with roomId and the recipient with personEmail.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!