Quick question, and I hope this doesn't turn into a debate about REST specifics, just looking for a sane URL scheme.<div><br></div><div>Say I have an app for managing technical conferences. There's one "user" table. A "user", of course, can be both a presenter and an attendee of sessions. So, I want to get a list of sessions a user is associated with, but also want to get separate lists for sessions they are a presenter for vs. sessions they are just attending.</div>
<div><br></div><div>In the db there's attendee_session and presenter_session link tables to associate users with the sessions.</div><div><br></div><div>This seems a bit ambiguous, plus not sure what to do if a user happens to be a presenter AND an attendee of the same session.</div>
<div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>GET /user/1234/sessions </div></blockquote><div><br></div><div>And these seem wrong because the query parameter is about the user not the session. That is, seems like any query parameters should be limiting on the session (e.g. session_type).</div>
<div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>GET /user/1234/sessions?user_type=attendee</div><div>GET /user/1234/sessions?user_type=presenter </div>
</blockquote><div><br></div><div>Other options would be:</div><div><br></div><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"><div>GET /user/1234/sessions_attending</div>
<div>GET /user/1234/sessions_presenting</div></blockquote><div><br></div><div><br></div><div>What would you use?</div><div><br></div><div><br>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org" target="_blank">moseley@hank.org</a><br>
</div>