<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi everyone,</p>
<p>so here is what I think about how the API should look like.</p>
<ul>
<li>Requests that change state should be POST (add items to
service, send live, show next|previous slide|item, show
desktop|black|..., ...)</li>
<li>The parameters that are sent with the requests should _not_ be
in json. They are currently always a number or a string. This
should be either a simple GET parameter (?param=value) or when
appropriate in a POST request</li>
<li>Requests that result in actions that don't need to return
anything, should return an empty response on success with a 2XX
status Code</li>
<ul>
<li>Failures should have a proper error code (4XX or 5XX) and
contain a json string in the body { "text": "some text
describing the error" } (the key could also be "error" or
anything else really) and maybe other relevant information
under other keys</li>
</ul>
<li>Requests that return data should return the data in the top
level of the json string so { data } and not { "key": data } if
they only return one object or a list (currently always the
case)</li>
</ul>
<p>I have created a kanban board for this, as to not clutter the
general board. It's available here
<a class="moz-txt-link-freetext" href="https://kanban.openlp.io/b/MQvnWRGeMiF6mbmeL/remote-api-changes">https://kanban.openlp.io/b/MQvnWRGeMiF6mbmeL/remote-api-changes</a></p>
<p>It's a public board, and if you want to say something about the
requested changes, just provide me with your details, so I can add
you. I have labelled them with either low priority (green) or high
priority (red). I don't regard my last point mentioned above as
that important, but I really think the request data shouldn't be
handled like it's currently done.</p>
<p> The angular project lives in a GitLab repository here
<a class="moz-txt-link-freetext" href="https://gitlab.com/thelinuxguy/openlp-remote">https://gitlab.com/thelinuxguy/openlp-remote</a></p>
<p>The master branch is still the old (working) version running an
older version of angular, while the angular-6 branch
(<a class="moz-txt-link-freetext" href="https://gitlab.com/thelinuxguy/openlp-remote/tree/angular-6">https://gitlab.com/thelinuxguy/openlp-remote/tree/angular-6</a>) is
the version I'm currently working on which doesn't work yet. The
UI renders, but no interaction with OpenLP has been tested yet...</p>
<p>If you want to give it a spin, download it, run "yarn install"
followed by a "ng serve" to get it up. If you want to contribute
to that, merge requests are welcome, or just create issues or
email me if you don't have/want to create an account over at
GitLab.</p>
<p><br>
</p>
<p>cheers,</p>
<p>Simon<br>
</p>
</body>
</html>