300-910 · Question #74
Drag and drop the code from the bottom onto the box where the code is missing to post a message to a Cisco Webex space. Not all options are used.
This question tests knowledge of the Cisco Webex REST API, specifically how to construct a Python HTTP POST request to send a message to a Webex space (room). It is commonly assessed on the Cisco DevNet Associate (200-901 DEVASC) exam.
Question
Exhibit
Explanation
This question tests knowledge of the Cisco Webex REST API, specifically how to construct a Python HTTP POST request to send a message to a Webex space (room). It is commonly assessed on the Cisco DevNet Associate (200-901 DEVASC) exam.
Approach. To post a message to a Webex space, you must use the requests library to send an HTTP POST to the endpoint 'https://webexapis.com/v1/messages'. The request requires an Authorization header with a Bearer token (e.g., 'Bearer <your_token>') and a Content-Type of 'application/json'. The JSON body payload must include at minimum 'roomId' (the target space ID) and 'text' (the message content). The correct code structure is: url = 'https://webexapis.com/v1/messages', headers = {'Authorization': 'Bearer <token>', 'Content-Type': 'application/json'}, payload = {'roomId': '<room_id>', 'text': 'message'}, then response = requests.post(url, headers=headers, json=payload).
Concept tested. Cisco Webex REST API usage - constructing an authenticated HTTP POST request in Python using the requests library to send a message to a Webex space, including correct endpoint selection, Bearer token authorization, and JSON payload structure with 'roomId' and 'text' fields.
Reference. Cisco DevNet Associate Exam (200-901 DEVASC) - Webex APIs section; Cisco Webex REST API documentation at developer.webex.com/docs/api/v1/messages/create-a-message
Topics
Community Discussion
No community discussion yet for this question.
