Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 6
    404 is not about availability, it's about existence. Just because a service is not available in some circumstances you shouldn't provide a 404 response unless you want people to believe that it does not exist at all. A 404 response would be meaningless for this situation. Commented Jul 12, 2018 at 16:51
  • @jules According the spec for 403 (which could be out of date): "If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead." emphasis mine. So if 403 is OK, then 404 would also be, but not necessarily for the reason given. Commented Jul 12, 2018 at 17:57
  • @JimmyJames - yes, it's within the specification, but is a really bad idea because it makes debugging problems extremely difficult. Not what you want in an API. Commented Jul 12, 2018 at 19:28
  • 3
    @Jules The service doesn't exist in some areas. Much like there are many small stores that only exist in my city, so asking their address in another city the correct response is "doesn't exist." Commented Jul 13, 2018 at 0:04
  • ehmm talking about "existance" about a service url path is the least - philosophical, for the sake of clarity once you publish a path you must provide an answer, 403 is the way to go in this case, with some kind of verbal description of the situation. Commented Jul 13, 2018 at 9:13