hardMultiple ChoiceObjective-mapped
200-901 Practice Question: A Python script uses the requests library to…
A Python script uses the requests library to authenticate to Cisco DNA Center. The script receives a 401 Unauthorized error even though the credentials are correct. Which of the following is a likely cause?
⚠ Common exam trap
Cisco often tests the distinction between credential-based authentication (which returns 401 if credentials are wrong) and token-based authentication (which returns 401 if the token is expired or missing), leading candidates to incorrectly focus on the credentials themselves rather than the token lifecycle.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The token has expired
In Cisco DNA Center, API authentication uses a token-based mechanism. The script first obtains a token via POST to /dna/system/api/v1/auth/token, then uses that token in subsequent requests. A 401 error with correct credentials typically means the token has expired (default lifetime is 1 hour) or was not included in the Authorization header. Option D is correct because the token, not the credentials, is being validated for each API call.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The request is using HTTP instead of HTTPS
Why it's wrong here
Using HTTP may cause a redirect or error, but with correct credentials, 401 is unlikely.
- ✗
The Content-Type header is not set to application/json
Why it's wrong here
Missing Content-Type usually results in a 400 Bad Request.
- ✗
The API endpoint is incorrect
Why it's wrong here
An incorrect endpoint typically returns 404 Not Found.
- ✓
The token has expired
Why this is correct
Cisco DNA Center uses token-based authentication; an expired token returns 401.
Go deeper
Related to this question
About these practice questions
This 200-901 question is part of Courseiva's 989-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.