⚠️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?