nerdexam
CiscoCisco

200-901 · Question #407

200-901 Question #407: Real Exam Question with Answer & Explanation

The question requires completing a Python script to create a Cisco Webex meeting via API by dragging the correct HTTP method, endpoint, authentication token, and request payload into the appropriate blanks.

Understanding and Using APIs

Question

Drag and Drop Question Refer to the exhibit. A bespoke meeting booking system must be integrated with Cisco Webex so that meetings are created automatically. Drag and drop the code from the bottom onto the box where the code is missing to create a sample meeting. Not all options are used. \ Answer:

Explanation

The question requires completing a Python script to create a Cisco Webex meeting via API by dragging the correct HTTP method, endpoint, authentication token, and request payload into the appropriate blanks.

Approach. To correctly complete the Python code for creating a Cisco Webex meeting:

  1. First Blank (line 3): The headers dictionary includes 'Authorization': f'Bearer {token}'. This clearly indicates that the variable holding the JWT string ='eyJhbGc ... yJBN8' should be named token. Therefore, drag token into this blank.
  2. Second Blank (requests.request method): The API documentation (first image) specifies POST /v1/meetings for creating a meeting. Thus, the HTTP method for the requests.request() call must be POST. Drag POST into this blank.
  3. Third Blank (requests.request endpoint): The API documentation (first image) shows /v1/meetings as the specific endpoint for creating meetings. However, the provided 'Answer Area' (third image), which represents the correct solution, shows v1/meeting dragged into this position. Following the provided solution image, v1/meeting is the expected choice for this question.
  4. Fourth Blank (json.dumps data): The payload dictionary, defined earlier in the code, contains all the necessary meeting details (title, password, start, end) that conform to the API's body parameters. The json.dumps() function serializes this Python dictionary into a JSON string for the request body. Therefore, payload is the correct argument to pass to json.dumps(). Drag payload into this blank.

Common mistakes.

  • common_mistake. 1. Dragging PUT for the HTTP method: PUT is typically used for updating an existing resource, whereas POST is used for creating a new resource, as explicitly stated by the POST /v1/meetings in the API documentation. Using PUT would result in an incorrect API call.
  1. Dragging v1/meetings for the API endpoint: Although the API documentation (first image) clearly states /v1/meetings as the endpoint, the provided 'Answer Area' (third image) marking the correct solution shows v1/meeting as the correct option. In the context of this specific exam question, selecting v1/meetings would be marked incorrect if v1/meeting is the intended answer per the provided solution.
  2. Dragging any option other than token for the variable assignment: The Authorization header explicitly references {token}, so assigning any other variable name to the JWT string would lead to a NameError or incorrect authorization.
  3. Dragging any option other than payload for json.dumps() data: The payload dictionary is specifically constructed with the meeting data required by the API. Passing any other value to json.dumps() would result in an incorrect or empty request body, causing an API error.

Concept tested. REST API interaction, understanding of HTTP methods (POST for creation), API endpoint identification, API authentication using bearer tokens, JSON data serialization in Python (json.dumps()), and interpreting API documentation.

Topics

#Cisco Webex API#REST API#JSON Payload#API Integration

Community Discussion

No community discussion yet for this question.

Full 200-901 PracticeBrowse All 200-901 Questions