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

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

Question

DRAG DROP - Drag and drop the code snippets into the correct order to create a Python Webex Teams REST API script that performs this sequence of tasks: create a Space, add a user to the Space, post the word "test" in the Space.

Assume that the Python "requests" module has already been imported.

Select and Place:

Answer Area

Step 1

Step 2

Step 3

Step 4

Step 5

payload = { ‘roomId: respl.json()[‘id’], ‘text’: ‘test’ }
resp2 = requests.post (url + ‘/messages’, headers-headers, json=payload)

if resp2.status_code — 200:
print (‘Success!7)

headers = { ‘Content-type’: ‘application/json’,
‘Authorization’: ‘Bearer YTQzMzBiZmItNDJKNCO643-417974-ad72cae0e10£' }
url = ‘https: //api.ciscospark.com/v1

payload = { ‘title’: ‘test’ }
respl = requests.post (url + ‘/rooms’, headers-headers, json—payload)

payload = { ‘roomId: respl.json()[‘id’], ‘personEmail’: ‘test@test.com’ }
requests.post (url + ‘/memberships’, headers-headers, json=payload)

Explanations

Answer Area

headers = { ‘Content-type’: ‘application/json’,
‘Authorization’: ‘Bearer YTQzMzBiZmItNDJKNCO643-417974-ad72cae0e10£' }
url = ‘https: //api.ciscospark.com/v1

payload = { ‘roomId: respl.json()[‘id’], ‘personEmail’: ‘test@test.com’ }
requests .post (url + ‘/memberships’, headers-headers, json=payload)

payload = { ‘title’: ‘test’ }
respl = requests.post (url + ‘/rooms’, headers-headers, json—payload)

payload = { ‘roomId: respl.json()[‘id’], ‘text’: ‘test’ }
resp2 = requests.post (url + ‘/messages’, headers-headers, json=payload)

if resp2.status_code — 200:
print (‘Success!7)

payload = { ‘roomId: respl.json()[‘id’], ‘text’: ‘test’ }
resp2 = requests.post (url + ‘/messages’, headers-headers, json=payload)

if resp2.status_code — 200:
print (‘Success!7)

headers = { ‘Content-type’: ‘application/json’,
‘Authorization’: ‘Bearer YTQzMzBiZmItNDJKNCO643-417974-ad72cae0e10£' }
url = ‘https: //api.ciscospark.com/v1

payload = { ‘title’: ‘test’ }
respl = requests.post (url + ‘/rooms’, headers-headers, json—payload)

payload = { ‘roomId: respl.json()[‘id’], ‘personEmail’: ‘test@test.com’ }
requests .post (url + ‘/memberships’, headers-headers, json=payload)