300-835 · Question #42
300-835 Question #42: Real Exam Question with Answer & Explanation
``python import requests ip = "cms_core" url = "https://{0}:445/api/v1/outboundDialPlanRules".format(ip) domain = "cisco.com" priority = 10 encryption = "encrypted" token = "78DHEBgD9R76hbd" payload='priority={0}&domain={1}&sipControlEncryption={2}'.format(priority, domain, encry
Question
Drag and drop the code snippets from the bottom onto the blanks in the Python script to create an outbound dial plan rule using the Cisco Meeting Server API. Not all options are used.
Explanation
import requests
ip = "cms_core"
url = "https://{0}:445/api/v1/outboundDialPlanRules".format(ip)
domain = "cisco.com"
priority = 10
encryption = "encrypted"
token = "78DHEBgD9R76hbd"
payload='priority={0}&domain={1}&sipControlEncryption={2}'.format(priority, domain, encryption)
headers = {
'Authorization': 'Bearer token {}'.format(token),
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.request("POST", url, headers=headers, data=payload)
Explanation: priority is the correct variable to format into the payload. Bearer token is the authorization scheme used for API tokens. token holds the actual bearer token. POST is used to create new dial plan rules via the API.
Topics
Community Discussion
No community discussion yet for this question.