nerdexam
Cisco

300-920 · Question #65

Drag and Drop Question The Express framework receives a Webex Teams webhook event when someone presses a button in an Adaptive Card. Drag and drop the property names onto the code snippet to access…

The correct answer is post; action; form; data. This question tests the understanding of how to configure an Express.js endpoint to receive Webex Teams Adaptive Card webhook events and parse their payloads to extract specific form data.

Messaging

Question

Drag and Drop Question The Express framework receives a Webex Teams webhook event when someone presses a button in an Adaptive Card. Drag and drop the property names onto the code snippet to access the form field named "preference". Not all options are used. Answer:

Exhibit

300-920 question #65 exhibit

Answer Area

Drag items

actiondataformgetinputspost

Correct arrangement

  • post
  • action
  • form
  • data

Explanation

This question tests the understanding of how to configure an Express.js endpoint to receive Webex Teams Adaptive Card webhook events and parse their payloads to extract specific form data.

Approach. To correctly complete the code snippet, the following drags and drops are required:

  1. app. [post] ('/cardcatcher', ...): Webhooks, especially those triggered by events like button presses or form submissions, send data to the server using HTTP POST requests. Therefore, 'post' is the correct HTTP method for the Express route.
  2. webex.attachmentActions. [action] (req.body. [form] .id): When an Adaptive Card button is pressed, the Webex Teams platform sends a webhook event. The req.body of this event contains information about the submitted action. To retrieve the full details of the attachment action using the Webex SDK, an ID is required. Based on the provided solution, the ID is located at req.body.form.id. The method called on webex.attachmentActions to retrieve the action details, as indicated by the solution, is action. While webex.attachmentActions.get(id) is a common SDK method for this, given the available options and the specific structure of the question, 'action' is used here to represent the method.
  3. lunchPreference = cardSubmission. [data] .preference;: After successfully retrieving the cardSubmission object, the actual form field values submitted by the user in the Adaptive Card are typically nested under a property of this object. The solution indicates that 'data' is the property containing the form field 'preference'. Therefore, 'data' should be dragged to this blank.

Common mistakes.

  • common_mistake. Common mistakes include using 'get' for the Express route, which is incorrect because webhooks are almost exclusively POST requests for data submission. Another mistake would be incorrectly identifying the path to the attachment action ID within req.body (e.g., using data or action instead of form if the webhook payload structure specifically uses form). Similarly, using 'inputs' instead of 'data' for cardSubmission. [BLANK] .preference would be incorrect if the specific Webex implementation or SDK version used in the scenario expects the submitted form values under the 'data' property. The options 'get' and 'inputs' are left unused in the correct solution.

Concept tested. Express.js route handling for POST requests, JSON body parsing middleware, understanding Webex Teams webhook payload structure for Adaptive Card submissions, and accessing submitted form data from Webex attachment actions.

Topics

#Webex Webhooks#Adaptive Cards#Express.js#Payload Parsing

Community Discussion

No community discussion yet for this question.

Full 300-920 Practice