Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Your these urls seem fine :</p> <blockquote> <p><a href="http://example.com/cases" rel="nofollow">http://example.com/cases</a> (and with id for a single case)</p> <p><a href="http://example.com/cases/" rel="nofollow">http://example.com/cases/</a>{id}/users (same idea as above)</p> <p><a href="http://example.com/cases/" rel="nofollow">http://example.com/cases/</a>{id}/messages (same idea as above)</p> </blockquote> <p>In terms of your related data and how to query them, I'd suggest that first of all you should decide on the return data structure, considering the fact that in both cases you are returning "messages" (although containing somewhat different data). What I would do is, I would have a common json structure for both related resources urls something along the lines of </p> <blockquote> <p>{"sender": "an user test",</p> <p>"receiver": "an user test4",</p> <p>"amount_messages": 3,</p> <p>"timestamp": 12312421424}</p> </blockquote> <p>And my resource urls would look somewhat like this:</p> <blockquote> <p>GET <a href="http://example.com/cases/" rel="nofollow">http://example.com/cases/</a>{id}/messages</p> <p>GET <a href="http://example.com/cases/" rel="nofollow">http://example.com/cases/</a>{id}/messages?receiver=testuser1&amp;sender=testuser2</p> </blockquote> <p>I don't understand the reason for that "/analysis" in the url. It's a bit more redundant (unless ofcourse there is a very specific reason for it). The clients who are going to use your apis are expecting the return data to be generic, especially when they are trying to do filter queries on the same resource. In your case, we are either listing "message traffic" (which I would call listing "all messages") OR listing "message traffic" WHERE sender is FOO and receiver is BAR (which I would call filtering the "all messages" data by sender and receiver information.</p> <p>Keeping the return data model consistent helps client developers to generate POJOs (in java land) and/or consistent data models on their side as well. </p> <p>I hope this helps ! good luck!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload