QuestionQ25

Understanding and Using APIs

Question Image

Refer to the exhibit. Complete the missing code to create a new room in Webex Teams. Not all options are used.

Drag & Drop
headers
request
PUT
title
POST
data
import requests

def createRoom(roomName):
    url = “https://webexapis.com/v1/rooms”
    payload = {“”: roomName}
     = {
        “Content-Type”: “application/x-www-form-urlencoded”,
        “Authorization”: TOKEN
    }
    requests.(“”, url, data=payload, headers=headers)
Explanation

Creating a Webex room uses the POST /v1/rooms endpoint and requires the title property. requests.request("POST", url, ...) sends that POST request while passing the payload and authorization headers.

Learn more

Community Discussion

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