<div dir="auto">I think the natural place for accountlines to exist is /account_lines. That said, for external consumers to use the API it is more readable to talk in terms of the patron and it's related resources.<div dir="auto">I consider the latter was a shortcut or alias and when a resource is created it should return the Location of the 'real' resource. For example</div><div dir="auto"><br></div><div dir="auto">POST /patrons/1/account/credits {amount: 100}</div><div dir="auto">=></div><div dir="auto">Location: /account_lines/30</div><div dir="auto">{</div><div dir="auto">type: payment</div><div dir="auto">amount: 100</div><div dir="auto">...</div><div dir="auto">}</div><div dir="auto"><br></div><div dir="auto"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">El vie., 8 de noviembre de 2019 08:49, Lari Taskula <<a href="mailto:lari.taskula@hypernova.fi">lari.taskula@hypernova.fi</a>> escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Hey Koha developers!</p>
<p>I would like to ask your opinion on endpoint structure for many
patron-related api endpoints. We have two options for the path
structure, let's say for accountlines:</p>
<p><font size="-1"><b>/patron/{patron_id)/account</b> (currently in
use)</font><br>
</p>
<p>OR</p>
<p><font size="-1"><b>/account</b> (not implement, (perhaps some
other name would be better))</font></p>
<p>I understand why the first one makes sense and it is pretty
straight-forward to use when you are dealing with a specific
patron.</p>
<p>But, the problem with this choice is that we lose the ability to
query other sets of accountlines data. For example, how would you
get a list of accountlines from today? There may not currently be
need for such exact query, but it should be possible if we want a
more complete API.<br>
</p>
<p>My question is, when creating new endpoints that are closely tied
to another object, such as accountlines to patron, do we also want
to support the full accountlines object via its own endpoint? It
would make sense for listing different sets of accountlines data.<br>
</p>
<pre cols="72">--
Lari Taskula
Software Developer, Koha-Suomi Oy
CEO, Hypernova Oy
+358449857337
Kauppakatu 25 C 409
80100 Joensuu, Finland</pre>
</div>
_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org" target="_blank" rel="noreferrer">Koha-devel@lists.koha-community.org</a><br>
<a href="https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer noreferrer" target="_blank">https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer noreferrer" target="_blank">http://bugs.koha-community.org/</a><br>
</blockquote></div>