API Responses
API Response Codes Explained π¦π
The API uses conventional HTTP response codes to indicate the success or failure of an API request. These codes are grouped into different ranges, each signifying a specific type of response.
π’ Success Responses (2xx
)
200 OK π: This response indicates that the request has been successfully received, understood, and accepted. It's the standard response for successful HTTP requests where the server returns the requested data.
201 Created π: A new resource has been created as a result of the request. The URI of the new resource is typically returned in the
Location
header field.204 No Content π: The server has successfully fulfilled the request, and there is no additional content to send in the response payload body.
Other codes in the
2xx
range indicate success overall. These responses mean that the request was received, understood, and processed correctly.
π΄ Client Error Responses (4xx
)
Codes in the
4xx
range signify client errors β. These errors occur when the request contains incorrect information or is incomplete. Examples include:400 Bad Request π«: The server cannot process the request due to a client error.
401 Unauthorized π: Authentication is required and has failed or has not been provided.
404 Not Found π: The requested resource is not available.
422 Unprocessable Entity π§©: The request was well-formed but was unable to be followed due to semantic errors.
π΅ Server Error Responses (5xx
)
Codes in the
5xx
range highlight server errors π¨ with Waitwhile's servers. These indicate failures on the server side that are outside the client's control. Examples include:500 Internal Server Error βοΈ: A generic error message when an unexpected condition was encountered.
503 Service Unavailable π§: The server is currently unable to handle the request due to temporary overloading or maintenance.
Understanding these response codes is vital for correctly interpreting the results of your API requests and troubleshooting potential issues.
Last updated
Was this helpful?