350-401 Question 328
Single answerYou are using the Cisco DNA Center REST API to retrieve information about network devices. When you send a GET request to the '/dna/intent/api/v1/network-device' endpoint, you receive the following response:
{ "response": [], "statusCode": 401, "message": "Unauthorized" }
What is the most likely cause of this issue?
- A
The API token used in the request has expired or is invalid.
- B
The requested endpoint does not exist on the Cisco DNA Center.
- C
The JSON response payload format is incorrect.
- D
The REST API request method should be POST instead of GET.
Show answer and explanation
Correct answer: A
Explanation
The HTTP status code 401 (Unauthorized) is returned when the client fails to provide valid authentication credentials. In this case, the likely issue is an expired or invalid API token, which is used for authentication when making REST API calls to Cisco DNA Center. To resolve this, you should check the token and regenerate it if necessary.
- A. Correct.
Correct. A 401 status code indicates that the client is unauthorized, which often happens due to an invalid or expired API token. You need to verify and regenerate the token, if necessary.
- B. Incorrect.
Incorrect. A 401 status code does not indicate a nonexistent endpoint. If the endpoint were invalid, you would typically receive a 404 status code instead.
- C. Incorrect.
Incorrect. The response payload is correctly formatted, as it contains the expected fields ('response', 'statusCode', and 'message'). The issue is related to authorization, not formatting.
- D. Incorrect.
Incorrect. The GET method is appropriate for retrieving information from the '/dna/intent/api/v1/network-device' endpoint. Changing the method to POST is not relevant here.