nerdexam
Cisco

200-901 · Question #529

Refer to the exhibit. A network engineer must automate a workflow to get device volume data from Endpoint xAPI-enabled devices. The engineer prepares a Python script to send the request by adding an…

The correct answer is A. Access token must be changed with a valid one. An HTTP status code of 401 Unauthorized indicates that the client's request lacks valid authentication credentials for the target resource.

Understanding and Using APIs

Question

Refer to the exhibit. A network engineer must automate a workflow to get device volume data from Endpoint xAPI-enabled devices. The engineer prepares a Python script to send the request by adding an access token and device ID. However, the request receives a status code of 401. Which action solves the problem?

Exhibit

200-901 question #529 exhibit

Options

  • AAccess token must be changed with a valid one.
  • BNetwork connectivity between client and API must be fixed.
  • CInternal server problems that relate to code must be fixed.
  • DAPI endpoint must be restarted to serve again.

How the community answered

(30 responses)
  • A
    90% (27)
  • B
    7% (2)
  • D
    3% (1)

Why each option

An HTTP status code of 401 Unauthorized indicates that the client's request lacks valid authentication credentials for the target resource.

AAccess token must be changed with a valid one.Correct

An HTTP 401 status code explicitly means 'Unauthorized', indicating that the authentication credentials provided with the request, such as an access token, are either missing, invalid, or expired. Replacing the token with a valid one will resolve this authentication failure.

BNetwork connectivity between client and API must be fixed.

Network connectivity problems typically result in different error types, such as connection refused, timeout, or host unreachable, rather than a 401 status code.

CInternal server problems that relate to code must be fixed.

Internal server problems usually manifest as 5xx HTTP status codes (e.g., 500 Internal Server Error), not a 401 Unauthorized error.

DAPI endpoint must be restarted to serve again.

Restarting the API endpoint is a troubleshooting step for server-side issues, but a 401 error specifically points to client authentication failure, not necessarily a server endpoint problem that requires a restart.

Concept tested: HTTP 401 Unauthorized status code

Source: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401

Topics

#HTTP Status Codes#API Authentication#Access Tokens#API Error Handling

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice