200-901 Question 55
Single answerYou are developing an application that interacts with a Cisco DNA Center instance using its REST APIs. The application needs to retrieve a list of all devices managed by Cisco DNA Center. Which sequence of steps is required to authenticate and retrieve the data successfully?
- A
Send a GET request to the '/dna/system/api/v1/auth/token' endpoint to retrieve an authentication token, then use this token in the Authorization header to send a GET request to the '/dna/intent/api/v1/network-device' endpoint.
- B
Send a POST request to the '/dna/system/api/v1/auth/token' endpoint to retrieve an authentication token, then use this token in the Authorization header to send a GET request to the '/dna/intent/api/v1/network-device' endpoint.
- C
Send a GET request to the '/dna/intent/api/v1/network-device' endpoint with your username and password in the Authorization header.
- D
Send a POST request to the '/dna/intent/api/v1/network-device' endpoint with your username and password in the request body to retrieve the list of devices.
Show answer and explanation
Correct answer: B
Explanation
To interact with Cisco DNA Center APIs, you must first obtain an authentication token by sending a POST request to the '/dna/system/api/v1/auth/token' endpoint with valid credentials. This token is then used in the Authorization header for subsequent API calls, such as retrieving device information from the '/dna/intent/api/v1/network-device' endpoint. This sequence ensures secure communication and proper authentication.
- A. Incorrect.
Incorrect: The '/dna/system/api/v1/auth/token' endpoint requires a POST request, not a GET request, to retrieve the authentication token.
- B. Correct.
Correct: Cisco DNA Center requires you to authenticate by sending a POST request to the '/dna/system/api/v1/auth/token' endpoint to retrieve a token. This token is then used in the Authorization header when making subsequent API calls, such as a GET request to '/dna/intent/api/v1/network-device' to fetch device information.
- C. Incorrect.
Incorrect: Authentication in Cisco DNA Center does not involve directly embedding username and password in the Authorization header. Instead, an authentication token is obtained via a POST request.
- D. Incorrect.
Incorrect: The '/dna/intent/api/v1/network-device' endpoint is used to retrieve device data, but it requires an authentication token in the Authorization header, not username and password in the request body.