1 {% extends "base.html" %}
2 {% load url from future %}
6 {% block title %}{% trans "WolneLektury.pl API" %}{% endblock %}
8 {% block bodyid %}api{% endblock %}
14 <div class="normal-text white-box">
17 {% blocktrans with u=u|build_absolute_uri:request %}
18 WolneLektury.pl API resides under <code>{{ u }}</code>.
19 You can use it to access information about books, their fragments and
26 Default data serialization format is
27 <a href="http://en.wikipedia.org/wiki/JSON">JSON</a>,
28 but you can also use XML by appending <code>?format=xml</code>
29 query parameter to each URL.
35 The URLs in WolneLektury.pl API are:
40 <li><a href='/api/books/'>/api/books/</a> – {% trans "List of all books" %}
42 <li><a href='/api/authors/'>/api/authors/</a> – {% trans "List of all authors" %}</li>
43 <li><a href='/api/epochs/'>/api/epochs/</a> – {% trans "List of all epochs" %}</li>
44 <li><a href='/api/genres/'>/api/genres/</a> – {% trans "List of all genres" %}</li>
45 <li><a href='/api/kinds/'>/api/kinds/</a> – {% trans "List of all kinds" %}</li>
47 <li><a href='/api/themes/'>/api/themes/</a> – {% trans "List of all themes" %}</li>
51 {% url "api_book" "studnia-i-wahadlo" as e1 %}
52 {% url "api_tag" "authors" "edgar-allan-poe" as e2 %}
54 Each element of those lists contains a link (in a "href") attibute
55 which points to individual resource's details, i.e.:
56 <a href="{{e1}}">{{e1}}</a> or
57 <a href="{{e2}}">{{e2}}</a>.
62 {% blocktrans with "/api/authors/adam-mickiewicz/kinds/liryka/books/" as e %}
63 You can combine authors, epochs, genres and kinds to find only books matching
64 those criteria. For instance:
65 <a href="{{e}}">{{e}}</a>.
70 {% blocktrans with "/api/authors/adam-mickiewicz/kinds/liryka/parent_books/" as e %}
71 If you only want top-level books and not all the children, you can use /parent_books/, as in:
72 <a href="{{e}}">{{e}}</a>.
77 {% url "api_fragment" "sen-nocy-letniej" "1290526312912-3814598192" as f %}
78 {% blocktrans with "/api/authors/william-shakespeare/themes/zabawa/fragments/" as e %}
79 The same way, using also books and themes, you can search for a list of fragments:
80 <a href="{{e}}">{{e}}</a>.
81 Again, each entry has a "href" attribute which links to the fragment's details, i.e.:
82 <a href="{{f}}">{{f}}</a>.