QuestionQ582

Understanding and Using APIs

Question Image

Refer to the exhibit. A network engineer needs to manage the network devices. The engineer prepares a Python script to authenticate to the Cisco DNA Center API and request a device list. The device request fails and returns error code 401. Which action resolves the issue?

  • A Update the credentials that are already supplied and retry the request.
  • B Send the request to another network in case there are reachability issues.
  • C Send the Authentication header in the request with a valid configuration.
  • D Update the API URL, which matched the API endpoint for device list.
Explanation

Cisco Catalyst Center uses token-based authentication. After obtaining a token from /dna/system/api/v1/auth/token, every subsequent API request must include that token in the X-Auth-Token header. Omitting the header leaves the device-list request unauthorized, resulting in HTTP 401.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!