300-435 Question 245
Single answerYou are tasked with automating a process to retrieve a list of devices connected to a Cisco SD-WAN vManage instance. Which step is essential to include in your Python script to successfully perform an API request to retrieve this information?
- A
Authenticate with the vManage API using an access token or session cookie.
- B
Directly send a GET request to the vManage API endpoint without authentication.
- C
Use the 'requests' Python library to send a POST request to the device configuration endpoint.
- D
Retrieve the API token from an external secret manager and pass it directly in the URL query string.
Show answer and explanation
Correct answer: A
Explanation
To interact with the Cisco SD-WAN vManage API, authentication is a critical first step. The API requires an access token or session cookie to authorize requests. Without this, any attempt to retrieve data, such as a list of devices, will fail with an authorization error.
- A. Correct.
Correct. Authentication is a mandatory step for interacting with the Cisco SD-WAN vManage API. Without authenticating, the API requests will fail.
- B. Incorrect.
Incorrect. Authentication is required before sending any request to the vManage API. Skipping authentication will result in unauthorized access errors.
- C. Incorrect.
Incorrect. While the 'requests' library can be used for API calls, a POST request to the device configuration endpoint is not relevant for retrieving a list of devices. Additionally, proper authentication is still required.
- D. Incorrect.
Incorrect. While retrieving the API token from an external secret manager is a good security practice, passing it in the URL query string is not secure. The token should be passed in headers or as part of a session.