nerdexam
CiscoCisco

300-835 · Question #21

300-835 Question #21: Real Exam Question with Answer & Explanation

import requests, json, os header = { "Authorization" : "Bearer " + os.environ.get("BOT_TOKEN"), "Content-Type": "application/json" } message = "The bot says: \nI am a developer too!" payload = {"roomId": os.environ.get("SPACE_ID"), "markdown": message} res = requests.post(url = "

Cloud Collaboration

Question

Drag and Drop Question. Refer to the exhibit. A developer has implemented ChatOps to a Webex Teams space as described in the exhibit. The Python script that pushes the notifications to the Teams space is shown. Drag and drop the code to complete the script. Not all options are used.

Explanation

import requests, json, os

header = { "Authorization" : "Bearer " + os.environ.get("BOT_TOKEN"), "Content-Type": "application/json" }

message = "The bot says: \nI am a developer too!"

payload = {"roomId": os.environ.get("SPACE_ID"), "markdown": message}

res = requests.post(url = "https://api.ciscospark.com/v1/messages", headers=header, data=json.dumps(payload), verify=True)

if res.status_code == 200: print("Your message was successfully posted to Webex Teams") else: print("Failed with status code: %d" % res.status_code)

Topics

#ChatOps#Webex Teams API#Python Scripting#API Integration

Community Discussion

No community discussion yet for this question.

Full 300-835 PracticeBrowse All 300-835 Questions