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 ...
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=...
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 ...
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).
...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
rest × 1595api × 423
api-design × 412
design × 154
http × 140
web-api × 129
architecture × 124
web-services × 118
java × 114
microservices × 79
json × 71
design-patterns × 65
web-applications × 63
authentication × 56
web-development × 49
security × 48
http-request × 43
c# × 42
database × 42
hateoas × 39
domain-driven-design × 36
php × 35
javascript × 31
spring × 27
soap × 27