| title | layout |
|---|---|
General notes |
docs |
This document informs about specifics of the HTTP protocol and other general information useful when dealing with an ALD server. It also includes notes specific to the libba.net implementation.
The root URL for all API requests must be the same. It must support HTTPS (see below).
http://api.libba.net/. HTTPS can be used via https://api.libba.net/.
Unless otherwise noted, ALD servers must support the following output content types for all usual output methods:
- JSON (
application/json) - XML (
application/xml)
The output schematics must match those described in these docs.
Furthermore, servers may support any other output content type or alias them to other mime-types.
application/xml is aliased to text/xml.
ALD servers must obey the Accept header sent by the client. If they do not support the specified types, they must return the respective HTTP error code 406
with a list of supported content types.
In case the requested type is supported, the server output must be explicitly labeled with the content type it contains via the Content-Type header.
When a response is described as "empty", this means the server should return a 204 No content HTTP status code with an empty HTTP body.
Several methods in this API require authentication. They must of course not be accessed without valid credentials. The authentication method being used can either be HTTP Basic Auth or Digest Access Authentication. If, however, HTTP Basic authentication is supported, it must only be allowed via HTTPS.
In the documentation, you will find mentions of so-called "filters" for most of the API methods.
They are used to filter the output you get from a request, mostly for listing methods but in some
cases also for others. To enable a filter, just include it as a GET parameter in the request and
set it to the desired value. The output should then only include elements that match the filter condition.
Some of the filter parameters are so called "switches" which can either be on, off or undetermined. These can always take the following values:
yes,true,+1or1: the filter is onbothor0: the filter is undeterminedno,falseor-1: the filter is off
Note that the default value of the switch if you do not include the filter in your request does not have to be undetermined, it can also be off or on. See the filter's documentation for the default value.
For the listing APIs, you also have the ability to sort the output. All sorting directives are specified
using the GET parameter sort. It consists of a list of sorting criteria ordered by precedence and
separated with +. By default, all criteria are sorted ascending, to reverse this, prefix the criteria
with an exclamation mark. The sorting criteria you can use are documented with the method they apply to.
An example of a sorting parameter could be:
...?sort=name+!version
This sorts the output first by name (ascending), and if there are two output elements with the same name, they are sorted by version (descending).