QuestionQ39
VerifiedUnderstanding and Using APIsDrag the code choices from the bottom into the missing-code boxes to authenticate to the Cisco DNA Center REST API with basic authentication, then generate a token for later use. Not every option is needed.
Drag & Drop
import requests from requests.auth import HTTPBasicAuth BASE_URL = 'https://sandboxdnac2.cisco.com' AUTH_URL = '/dna/system/api/v1/' USERNAME = 'admin' PASSWORD = 'qwer1234!' response = requests.(BASE_URL + AUTH_URL, auth=HTTPBasicAuth(, )) token = response.json()['Token'] print(token)
Community Discussion