QuestionQ55

VerifiedUnderstanding and Using APIs

Question Image

Refer to the exhibit. A script must create a new team, create a new space, send a message, and create a participant. Drag the code snippets from the bottom into the boxes in the code to complete the script. Not every option is used.

Drag & Drop
import requests

base_url = “https://webexapis.com/v1”
email = “admin@example.com”
name = “Admin”
header = {“key”: “value”}

url = “{}/{}”.format(base_url, “/teams”)
body = 
team_id = requests.post(url, headers=header, data=body).json() [‘id’]

url = “{}/{}”.format(base_url, “/rooms”)
body = 
team_id = requests.post(url, headers=header, data=body).json() [‘id’]

url = “{}/{}”.format(base_url, “/messages”)
body = 
requests.post(url, headers=header, data=body)

url = “{}/{}”.format(base_url, “/people”)
body = 
requests.post(url, headers=header, data=body)
Explanation

A Webex team is created with its required name. A team room requires both title and teamId, and a message must identify the destination with roomId and provide text. Creating a person requires emails; displayName is the applicable supplied display-name property. The Rooms API specifically requires teamId when creating a room in a team.

Learn more

Community Discussion

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