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…
Question
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
| Field | Purpose | What breaks without it |
|---|---|---|
POST method | Creates a new webhook resource | Using GET only reads existing webhooks; no subscription is made |
Authorization: Bearer | Authenticates as the bot identity | Request returns 401 Unauthorized; Webex doesn't know who is subscribing |
Content-Type: application/json | Tells Webex the body format | Body is misinterpreted; returns 400 Bad Request |
name | Human-readable label for the webhook | Required field; omitting returns validation error |
targetUrl | Where Webex sends the POST notification | Without this, Webex has nowhere to deliver events - the bot never receives anything |
resource | What object type to watch (messages, rooms, memberships) | Without it, Webex doesn't know what to watch |
event | Which 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
Community Discussion
No community discussion yet for this question.
