I have a REST webservice that encapsulates multiple external APIs.
Let's assume my customers can input a BookingId
to my REST
webservice. I then pass that id to the external api and return the booking, if possible.
Now, if the bookingid does not exist, the external API response with HTTP 200
and some custom message.
But I'd like to show the correct HTTP statuscode to my clients.
Question: which code would you expect a webservice to return incase you enter eg an invalid/nonexisting bookingid?
Probably one of the 4xx
client error codes? As the invalid bookingid was given by the client.
But which one?
400 Bad Request
if for invalid query parameters (not values).
404 Not Found
is for (static?) resources not available anymore.