nerdexam
Cisco

350-901 · Question #64

Refer to the exhibit. Which set of API requests must be executed by a Webex Teams bot after receiving webhook callback to process messages in a room and reply with a new message back to the same room?

The correct answer is D. GET /message&roomId=<ROOM_ID> POST /messages {"roomId":"<ROOM_ID>", "text":"<MESSAGE>"}. A Webex Teams bot must GET messages in the room to read the incoming message, then POST a new message to reply - using POST because it creates a new resource.

Cisco Platforms and Development

Question

Refer to the exhibit. Which set of API requests must be executed by a Webex Teams bot after receiving webhook callback to process messages in a room and reply with a new message back to the same room?

Exhibit

350-901 question #64 exhibit

Options

  • AGET /message&roomId=<ROOM_ID> POST /messages {"roomId":"<ROOM_ID>", "text":"<MESSAGE>"}
  • BGET /messages&mentionedPeople=me&roomId=<ROOM_ID> PUT /messages {"roomId":"<ROOM_ID>", "text":"<MESSAGE>"}
  • CGET /message&roomId=<ROOM_ID> PUT /messages {"roomId":"<ROOM_ID>", "text":"<MESSAGE>"}
  • DGET /message&roomId=<ROOM_ID> POST /messages {"roomId":"<ROOM_ID>", "text":"<MESSAGE>"}

How the community answered

(44 responses)
  • A
    9% (4)
  • B
    2% (1)
  • C
    5% (2)
  • D
    84% (37)

Why each option

A Webex Teams bot must GET messages in the room to read the incoming message, then POST a new message to reply - using POST because it creates a new resource.

AGET /message&roomId=<ROOM_ID> POST /messages {"roomId":"<ROOM_ID>", "text":"<MESSAGE>"}

Choice A incorrectly uses a singular '/message' endpoint that does not exist in the Webex Teams API; the correct endpoint is '/messages' (plural).

BGET /messages&mentionedPeople=me&roomId=<ROOM_ID> PUT /messages {"roomId":"<ROOM_ID>", "text":"<MESSAGE>"}

PUT /messages is incorrect because PUT updates an existing resource; replying to a room requires creating a new message with POST, and the mentionedPeople filter is unnecessary for a basic room reply.

CGET /message&roomId=<ROOM_ID> PUT /messages {"roomId":"<ROOM_ID>", "text":"<MESSAGE>"}

Choice C uses both an incorrect singular endpoint '/message' and PUT instead of POST, neither of which is valid for sending a new reply message in Webex Teams.

DGET /message&roomId=<ROOM_ID> POST /messages {"roomId":"<ROOM_ID>", "text":"<MESSAGE>"}Correct

After receiving a webhook callback, the bot retrieves the room's messages using GET /messages with the roomId query parameter to read the triggering message, then sends a reply by creating a new message resource with POST /messages including the roomId and text in the request body.

Concept tested: Webex Teams bot GET and POST messages API workflow

Source: https://developer.webex.com/docs/api/v1/messages

Topics

#Webex Teams API#Bot Programming#REST API Calls#Webhooks

Community Discussion

No community discussion yet for this question.

Full 350-901 Practice