Why Does a Cisco DNA Center Script Abort with 401 Unauthorized?

350-401 By islever Editorial Last updated

Short answer

B The username or the password is incorrect

Question

Refer to the exhibit. An administrator writes a script to fetch the list of devices that are registered with Cisco DNA Center. Why does the execution abort? - Exhibit: Why Does a Cisco DNA Center Script Abort with 401 Unauthorized?
  1. The TLS certificate of DNA Center is invalid
  2. The username or the password is incorrect Correct Answer
  3. The “dna-center” hostname cannot be resolved to an IP address
  4. The authentication URL is incorrect

Key Takeaways

The exam tests HTTP status code interpretation in Cisco DNA Center API calls, with 401 Unauthorized specifically pointing to invalid credentials rather than TLS, DNS, or URL issues.

This study guide explains why a Python script using Cisco DNA Center's REST API aborts with a 401 Unauthorized status code, confirming that incorrect username or password is the common cause according to exam community consensus.

Common mistake: Choosing option A (invalid TLS certificate) is a common mistake because SSL errors often cause script failures, but a 401 response is an HTTP status code that only appears after TLS handshake succeeds, indicating authentication failure.

Expert Analysis

Why the Answer Is Correct

A 401 Unauthorized status code is defined by HTTP/1.1 (RFC 7235) to indicate that the request lacks valid authentication credentials. In the context of Cisco DNA Center REST API, this means the script sent a request without proper authentication, often because the username or password provided in the Basic Auth header is incorrect. Comments from the community (e.g., votes with answer B) consistently identify this interpretation, confirming that the 401 response directly points to credential validation failure.

Additionally, the script execution aborts because the API returns an error response, and the code likely raises an exception or exits when it encounters a non-2xx status. Since the question specifically references an exhibit showing a 401 status, the administrator should check the credentials used in the script.

Why the Other Options Are Wrong

Option A (invalid TLS certificate) would cause an SSL/TLS handshake failure, typically resulting in a Python ssl.SSLError or requests.exceptions.SSLError, not an HTTP status code like 401. The script would be unable to connect at all. Option C (hostname unresolvable) would produce a socket.gaierror or DNS resolution error, preventing the HTTP request from being sent. Option D (incorrect authentication URL) would usually yield a 404 Not Found or a different endpoint error, not 401. A 401 response specifically means the request reached the server and authentication was attempted but failed.

Community Comment Notes

Comment [2] succinctly explains that a 401 status code usually indicates unauthorized access, which can happen if the provided username or password is incorrect. Comment [3] reinforces that 401 is returned when authentication credentials are invalid or missing. Comment [4] provides a formal definition of the 401 status code. These comments align with the prompt's vote distribution of 100% B, indicating a strong consensus and clear reasoning among candidates.

Official Reference

Exam Strategy

In Cisco DNA Center API questions, always map HTTP status codes to their exact meanings: 401 = invalid credentials, 403 = insufficient permissions, 404 = wrong endpoint, and SSL/DNS errors occur before HTTP statuses are returned. Look for the status code in any exhibit to quickly eliminate TLS and DNS options.

Community Votes

B
100%

100% of anonymous learners picked answer B. Votes are pick records left by other test-takers — they are not the verified answer.

Discussion 5 contributions

Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.

From public community threads 5

  1. [Removed] 👍 5 Answered B
    B is correct 200 OK 201 Created 204 No Content 301 Moved Permanently 302 Found 304 Not Modified 400 Bad Request 401 Unauthorized 403 Forbidden 404 Not Found 405 Method Not Allowed 408 Request Timeout 409 Conflict 500 Internal Server Error 501 Not Implemented 502 Bad Gateway 503 Service Unavailable 504 Gateway Timeout
  2. teems5uk 👍 3 Answered B
    B. The username or the password is incorrect. This is because a status code of 401 usually indicates unauthorized access, which can happen if the provided username or password is incorrect.
  3. chiacche 👍 2 Answered B
    status code 401 → A 401 Unauthorized error is typically returned when the authentication credentials (username and/or password) are invalid or missing.
  4. AbdullahMohammad251 👍 1 Answered B
    The 401 Unauthorized status code is an HTTP response indicating that the request has not been applied because it lacks valid authentication credentials for the target resource
  5. stefanxradu 👍 1 Answered B
    Agree with B

Reader comments & corrections

No reader corrections yet — spotted an error or have a note? Share it below.

Log in to comment, report an error, or add a note about this question.

Practice All 350-401 Questions

Access 218 questions with complete answers and detailed explanations.

View Full 350-401 Practice Test →

← Back to 350-401 Study Guide