Given we have a web service that takes numerical identifiers. What is the generally most agreed upon HTTP Status Code for an invalid (non-numerical) identifier?
Valid Resource Identifier
Request: GET http://service.co.uk/resources/123
Response: 200 OK
Valid but Unknown Resource Identifier
Request: GET http://service.co.uk/resources/456
Response: 404 Not Found
Invalid Resource Identifier
Request: GET http://service.co.uk/resources/abc
Response: 400 Bad Request
In the event of an invalid identifier, 404 (Not Found) accurately describes the situation; we failed to locate the resource. However 400 (Bad Request) gives an indication as to why the resource was not found.
RFC 2616
10.4.1 400 Bad Request
The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.
10.4.5 404 Not Found
The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.
400 Bad Requestis most appropriate but this question is likely to be closed because it's very opinion related.