Rest API Response Standards
By Ercan S. - 13/04/2025 - 0 comments
List - GET --------------------------------------------------------------------- Success - 200 OK - Return list of resulting entities matching the search criteria Success - 200 OK - Return an empty array Get Specific - GET --------------------------------------------------------------------- Success - 200 OK - The entity matching the identifier specified is returned as content Failure - 404 Not Found - No content Create - POST --------------------------------------------------------------------- Success - 201 Created - Return created object or its URL in the value of the Location header Failure - 400 Bad Request - Return details about the failure Async - 202 Accepted - Optionally return url for polling status Update - PUT --------------------------------------------------------------------- Success - 200 OK - Return the updated object Success - 204 No Content - No content Failure - 404 Not Found - No content Failure - 400 Bad Request - Return details about the failure Async - 202 Accepted - Optionally return url for polling status Partial Update - PATCH --------------------------------------------------------------------- Success - 200 OK - Return the patched object Success - 204 No Content - No content Failure - 404 Not Found - No content Failure - 400 Bad Request - Return details about the failure Async - 202 Accepted - Optionally return url for polling status Delete - DELETE --------------------------------------------------------------------- Success - 200 OK - No content Async - 202 Accepted - Optionally return url for polling status Generic Responses --------------------------------------------------------------------- Authorization Error (No Login) - 401 Unauthorized Authentication Error (Login) - 403 Forbidden Not Supported Methods - 405 Method Not Allowed Generic Server Error - 500 Internal Server Error
Tags: rest