Status code for object not found. I'm making GET users/57 REST API call and this user(id=57) doesn't exist. Shall I use 404 Status or what can be the status code used for this?
I would use error code 401 for unknown user, and not 404. 404 means the resource (IE the API endpoint) was not found.
401: Either you need to provide authentication credentials, or the credentials provided aren't valid.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With