Skip to main content
16 votes
Accepted

How to deal with public vs private version of same resource in a RESTFul API?

Ooof I'm just going to chime in with the opposite answer. I'm not saying its completely wrong to have a single endpoint, but there are things to consider... Try to avoid using the user role in ...
Ewan's user avatar
  • 86.7k
6 votes

How to deal with public vs private version of same resource in a RESTFul API?

If the resource has always the same return schema and just needs different behaviours, in this case filters to be applied, I would recommend a query parameter: /inventory?list=all vs /inventory?list=...
Bergi's user avatar
  • 1,417
5 votes

How to deal with public vs private version of same resource in a RESTFul API?

It is perfectly OK if users with different roles see different representations of the same resource, especially admin vs. ordinary users, which basically covers your case. Another common case is that ...
Hans-Martin Mosner's user avatar
2 votes

How to deal with public vs private version of same resource in a RESTFul API?

It seems to me that these two are not the same resource. Your shop's entire inventory. Analogous to the shop + what's in the back room. Your shop's available products for sale (catalog or listings). ...
Tvde1's user avatar
  • 380
1 vote

How to deal with public vs private version of same resource in a RESTFul API?

Most content management systems I have seen provide a technical backend UI to manage resources (as well as their meta data), and a user-friendly frontend to display nicely formatted web pages. So the ...
Doc Brown's user avatar
  • 222k

Only top scored, non community-wiki answers of a minimum length are eligible