exam questions

Exam 200-901 All Questions

View all questions & answers for the 200-901 exam

Exam 200-901 topic 1 question 82 discussion

Actual exam question from Cisco's 200-901
Question #: 82
Topic #: 1
[All 200-901 Questions]


Refer to the exhibit. A network engineer must 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 solves the problem?

  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
daniii89
4 months, 3 weeks ago
Selected Answer: C
The error 401 (Unauthorized) means that the authentication is failing. Looking at the script, the likely issue is that the authentication token is not included in the request headers when calling the network-device endpoint. Correct Answer: ✔ C. Send the Authentication header in the request with a valid configuration. Explanation: • The script correctly obtains an authentication token by sending a POST request to /dna/system/api/v1/auth/token. • However, after retrieving the token, the script does not include it in the headers for the GET request to /dna/intent/api/v1/network-device. • The Cisco DNA Center API requires an authentication token in the Authorization header for further API requests.
upvoted 1 times
...
mellohello
2 years, 5 months ago
Selected Answer: C
In the provided code, the authentication token is being requested and stored in the "token" variable, but it is not being included in the subsequent request for the device list. To solve the problem, the authentication token should be included in the request header as an "Authorization" field. For example: headers = {'Content-Type': 'application/json', 'Authorization': f'Bearer {token}'} This will include the necessary credentials in the request and allow it to be authenticated by the server.
upvoted 3 times
...
Mongskeee
2 years, 6 months ago
what if the error occurred on the request.post when getting the token due to incorrect credentials? how would we know if the error is due to the incorrect credentials or incorrect syntax due to header of the request.get doesn't contain the token/data?
upvoted 1 times
herrmann69
11 months, 2 weeks ago
It says "device request fails" which is the second request
upvoted 1 times
...
...
anagy11
3 years, 3 months ago
Selected Answer: C
Obtained token not used in the request for devices
upvoted 3 times
...
sds85
3 years, 3 months ago
Selected Answer: C
/dna/system/api/v1/auth/token API to obtain an access token. The token obtained using this API is required to be set as value to the X-Auth-Token HTTP Header for all API calls to Cisco DNA Center.
upvoted 2 times
...
sucre1
3 years, 4 months ago
Selected Answer: A
Since the HTTPBasicAuth description is correct The password is wrong. DNAC supports Basic Auth Base64 encoding https://developer.cisco.com/docs/dna-center/api/1-3-3-x/
upvoted 2 times
...
czifraj2
3 years, 4 months ago
Selected Answer: C
Its's C because we got a token but not used.
upvoted 4 times
...
CTshirt
3 years, 4 months ago
It's C
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...