nerdexam
CiscoCisco

200-901 · Question #563

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

This question assesses the ability to construct valid JSON request bodies for various API endpoints based on provided API documentation and a Python script's context.

Understanding and Using APIs

Question

Drag and Drop Question Refer to the exhibit. A script must create a new team, create a new space, send a message, and create a participant. Drag and drop the code snippets from the bottom onto the boxes in the code to complete the script. Not all options are used. Answer:

Explanation

This question assesses the ability to construct valid JSON request bodies for various API endpoints based on provided API documentation and a Python script's context.

Approach. The correct approach involves carefully matching the API endpoint being called in the script with its corresponding body parameters listed in the API documentation, then selecting the drag-and-drop snippet that provides the required parameters using the available variables.

  1. Create Team (/teams endpoint): The API documentation specifies 'name' as a required parameter for a Team. The snippet {"name": "New example collaboration"} correctly provides this parameter. This snippet is dragged to the first body = line.
  2. Create Room (/rooms endpoint): The API documentation requires 'title' and 'teamId' for a Room. The script has previously obtained team_id. The snippet {"title": "newRoom", "teamId": team_id} correctly provides both required parameters. This snippet is dragged to the second body = line.
  3. Send Message (/messages endpoint): The API documentation lists 'roomId' and 'text' as relevant parameters for messages. The script has previously obtained room_id. The snippet {"room_id": room_id, "text": "New text"} provides the room identifier and message content. While the API documentation uses 'roomId' (camelCase) and the snippet uses 'room_id' (snake_case), this is the only available option that correctly provides both the room identifier (using the room_id variable) and the message text. This snippet is dragged to the third body = line.
  4. Create Participant (/people endpoint): The API documentation specifies 'emails' as a required parameter and 'displayName' as a common optional parameter for People. The script defines email and name. The snippet {"emails": [email], "displayName": name} correctly provides the required 'emails' using the email variable and 'displayName' using the name variable, matching the documented parameter name. This snippet is dragged to the fourth body = line.

Common mistakes.

  • common_mistake. Common mistakes include:
  • Ignoring required parameters: Forgetting a required parameter, such as selecting {"title": "New example collaboration"} for Room creation, which is missing the required teamId.
  • Mismatched parameter names: Using an incorrect key name, such as {"name": "newRoom", "teamId": team_id} for Room creation when the API documentation explicitly requires 'title', not 'name'. Another example is using {"emails": [email], "name": name} for People creation, where the API documentation specifies 'displayName', not 'name'.
  • Disregarding case sensitivity or conventions: While the message body option uses room_id instead of the documented roomId, selecting any other option would result in missing critical parameters or using entirely incorrect ones. The provided options force the test-taker to choose the functionally closest match. Other options for messages, if available, might include an incorrect variable name or missing text content.
  • Not utilizing existing variables: Failing to use variables like team_id or room_id that were obtained from previous API calls, or email and name defined at the script's beginning.

Concept tested. The core concept tested is the ability to interpret API documentation for RESTful services, correctly construct JSON request bodies, and integrate these API calls into a programmatic context (Python script). This involves understanding required parameters, data types, variable usage, and attention to detail in parameter naming conventions.

Topics

#Webex API#API Calls#Python Scripting#API Client Libraries

Community Discussion

No community discussion yet for this question.

Full 200-901 PracticeBrowse All 200-901 Questions