nerdexam
Cisco

300-835 · Question #26

Refer to the exhibit. A bot is receiving notifications such as the one displayed in the exhibit. Drag and drop the code onto the snippet to complete the API request that was sent to Webex Teams so…

Webex Teams Bot Webhook Registration - Exam Explanation Overall Goal A Webex Teams bot does not poll for events. Instead, it registers a webhook - a subscription that tells Webex Teams: "When event X happens, POST a notification to my URL." The exhibit shows one of those…

Cisco Webex API

Question

Refer to the exhibit. A bot is receiving notifications such as the one displayed in the exhibit. Drag and drop the code onto the snippet to complete the API request that was sent to Webex Teams so that the bot will receive these notifications. Not all options are used.

Exhibit

300-835 question #26 exhibit

Explanation

Webex Teams Bot Webhook Registration - Exam Explanation

Overall Goal

A Webex Teams bot does not poll for events. Instead, it registers a webhook - a subscription that tells Webex Teams: "When event X happens, POST a notification to my URL." The exhibit shows one of those inbound notification payloads the bot received after a webhook was successfully registered.

The correct approach is a POST to https://webexapis.com/v1/webhooks with a JSON body describing what the bot wants to watch.


The Webhook Registration Request

POST https://webexapis.com/v1/webhooks
Authorization: Bearer <bot_token>
Content-Type: application/json

{
  "name":      "My Bot Webhook",
  "targetUrl": "https://mybot.example.com/events",
  "resource":  "messages",
  "event":     "created"
}

Step-by-Step Reasoning

FieldPurposeWhat breaks without it
POST methodCreates a new webhook resourceUsing GET only reads existing webhooks; no subscription is made
Authorization: BearerAuthenticates as the bot identityRequest returns 401 Unauthorized; Webex doesn't know who is subscribing
Content-Type: application/jsonTells Webex the body formatBody is misinterpreted; returns 400 Bad Request
nameHuman-readable label for the webhookRequired field; omitting returns validation error
targetUrlWhere Webex sends the POST notificationWithout this, Webex has nowhere to deliver events - the bot never receives anything
resourceWhat object type to watch (messages, rooms, memberships)Without it, Webex doesn't know what to watch
eventWhich action to fire on (created, updated, deleted)Without it, Webex doesn't know when to fire

The {} Option

In drag-and-drop format, {} typically represents the JSON body wrapper itself - it signals that the payload is a JSON object, not a query string or form data. It pairs with Content-Type: application/json. Without it, you have no body container for the fields above.


What the Notification in the Exhibit Tells You

The received notification is a Webex-generated POST to the bot's targetUrl. It contains:

  • resource - what triggered it (e.g., messages)
  • event - the action (e.g., created)
  • data.id - the ID of the new message (the bot must make a second API call to fetch the actual message text, since notifications don't include content directly)

This confirms the webhook was registered correctly - you work backwards from the notification shape to reconstruct the registration call.


Memory Tip

"PANT" - the four required JSON fields:

Post to webhooks → Name + TargetUrl + resource + eVent

Or think of it as a mailing subscription form: you write your name, your address (targetUrl), what magazine you want (resource), and how often - new issues only (event: created).


Common Trap

Many candidates confuse the registration call (one-time POST your bot makes to Webex) with the notification payload (what Webex sends to the bot repeatedly). The exhibit shows the notification, but the question asks you to reconstruct the registration - they are different HTTP requests in opposite directions.

Topics

#Webex Bots API#Webhooks#Event Notifications#API Integration

Community Discussion

No community discussion yet for this question.

Full 300-835 Practice