Question 28 of 28 from exam 300-835-CLAUTO: Automating Cisco Collaboration Solutions

Question 28 of 28 from exam 300-835-CLAUTO: Automating Cisco Collaboration Solutions

Question

DRAG DROP - Drag and drop the correct items from the right to complete this Python script to automate the creation of Cisco Webex Teams spaces and memberships.

Not all options are used.

Select and Place:

‘Answer Area

import requests Femponsa[ (a?)
def makePost (apiKey, url, body): personEmail
headers =
. vpearer ” + apikey, a
‘Content-Type’: “application/json”
+
response = requests.post (url = url, headers = headers, = body) data
return response ee
Authorization
def createspace(apikey, roomNane) :
url = “https: //api.ciscospark.com/v1/rooms/” = 7
cee membershipEmail
“title”: roomNane
2: apikey
response - makePost (apikey, url, body)
RocmaTek Authentication
return roomid
auth
def addMembership(apikey, roomId, membereshipEmail) :
url “https /api.ciscospark.com/v1/memeberships/” response.id
body {
“roomrd’": roomrd, ER rer rye

Sy js: mambershipzmail

makePost (apikey, url, body)

def main():
apikey = input ("What is your personal access token? ”)
spacename = input (“What is the name of the space you want to create? ”)
membershipEmail = input (%What is the email address of the person to add? ”)
roomId = createSpace(apikey, spaceName)
addMembership(apiKey, roomId, membershipEmail)

if __name \_main_':

Explanations

‘Answer Area

import requests Femponsa[ (a?)
def makePost (apiKey, url, body): personEmail
headers =
+ [authorization “bearer “ + apixey, a
‘content-Type’: “application/json”
+
response = requests.post (url = url, headers = headers, data = body) data
Setees ‘enpouee ee
Authorization
def createspace(apikey, roomNane) :
url = “https: //api..ciscospark.com/vi/roons/” ——
cee membershipEmail
“title”: roomNane
2: apikey
response - makePost (apikey, url, body)
roonld =[/ response.id ‘Authentication
return roomid
auth
def addMembership(apikey, roomId, membereshipEmail) :
url “https /api.ciscospark.com/v1/memeberships/” response.id
body {
“roomtd”": roomrd, ER rer rye

" personEmail : membershipzmail

makePost (apikey, url, body)

def main():
apikey = input ("What is your personal access token? ”)
spacename = input (“What is the name of the space you want to create? ”)
membershipEmail = input (%What is the email address of the person to add? ”)
roomId = createSpace(apikey, spaceName)
addMembership(apiKey, roomId, membershipEmail)

if __name ‘main’