API Error Handling and Debugging Flashcards
6 cards from real API practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 6 API Error Handling and Debugging flashcards as text
What is a 400 Bad Request status code used for?
Answer: The client sent a malformed or invalid request
400 Bad Request indicates the server cannot process the request due to client-side errors like invalid syntax, missing parameters, or malformed JSON.
What does a 422 Unprocessable Entity response typically indicate?
Answer: The request is well-formed but contains semantic errors or validation failures
422 Unprocessable Entity means the request was syntactically correct but semantically invalid — validation rules were violated.
What is the recommended structure for API error response bodies?
Answer: A structured object with error code, message, and details
Best practice error responses include a structured object with a machine-readable error code, human-readable message, and optional details for debugging.
What does a 503 Service Unavailable response indicate?
Answer: The server is temporarily unable to handle the request
503 Service Unavailable indicates the server is temporarily unable to handle the request, often due to maintenance or overload.
Which tool can be used to inspect raw HTTP API request and response traffic?
Answer: Charles Proxy or Wireshark
Charles Proxy and Wireshark are tools for capturing and inspecting raw HTTP/HTTPS traffic, invaluable for debugging API communication.
What is a 'correlation ID' (request ID) in API error handling?
Answer: A unique identifier per request enabling cross-system log tracing
A correlation ID is a unique identifier attached to each API request and propagated through all systems, enabling end-to-end log tracing for debugging.