Suppose you have an event and you wish to add members to that event. Would you design that as
event/:event-id/members/
? or just make it'/members'
where you specify the event id in the POST body ?Dealing with nested entities. For example. An Event has a Mini Event and You wish to add members to that Mini Event. So again, would have something like
event/:event-id/mini-event/:mini-event-id/members/
?
So in the above example, if you wanted to make modifications to member 1 added to that mini event, you'd have to access it like event/:event-id/mini-event/:mini-event-id/members/:member-id
which doesn't quite seem right to me because it's 3 level nesting.
Ofcourse, I'd like to know what's the most RESTful way of doing this. The general idea is that do you design APIs the way you have your Database entities modelled(mini events reference the primary key of the Event they are a part of and refer the user primary key as well in the above example) or should it be independent