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='{% url "api_book_list" "" %}'>
 
  41         {% url "api_book_list" "" %}</a> – {% trans "All books" %}
 
  42     <li><a href='{% url "api_audiobook_list" "" %}'>
 
  43         {% url "api_audiobook_list" "" %}</a> – {% trans "Audiobooks" %}
 
  44     <li><a href='{% url "api_daisy_list" "" %}'>
 
  45         {% url "api_daisy_list" "" %}</a> – {% trans "DAISY" %}
 
  47     <li><a href='{% url "api_tag_list" "authors" %}'>
 
  48         {% url "api_tag_list" "authors" %}</a> – {% trans "List of all authors" %}</li>
 
  49     <li><a href='{% url "api_tag_list" "epochs" %}'>
 
  50         {% url "api_tag_list" "epochs" %}</a> – {% trans "List of all epochs" %}</li>
 
  51     <li><a href='{% url "api_tag_list" "genres" %}'>
 
  52         {% url "api_tag_list" "genres" %}</a> – {% trans "List of all genres" %}</li>
 
  53     <li><a href='{% url "api_tag_list" "kinds" %}'>
 
  54         {% url "api_tag_list" "kinds" %}</a> – {% trans "List of all kinds" %}</li>
 
  56     <li><a href='{% url "api_tag_list" "themes" %}'>
 
  57         {% url "api_tag_list" "themes" %}</a> – {% trans "List of all themes" %}</li>
 
  61 {% url "api_book" "studnia-i-wahadlo" as e1 %}
 
  62 {% url "api_tag" "authors" "edgar-allan-poe" as e2 %}
 
  64 Each element of those lists contains a link (in a "href") attibute
 
  65 which points to individual resource's details, i.e.:
 
  66 <a href="{{e1}}">{{e1}}</a> or
 
  67 <a href="{{e2}}">{{e2}}</a>.
 
  72 {% blocktrans with "/api/authors/adam-mickiewicz/kinds/liryka/books/" as e %}
 
  73 You can combine authors, epochs, genres and kinds to find only books matching
 
  74 those criteria. For instance:
 
  75 <a href="{{e}}">{{e}}</a>.
 
  80 {% blocktrans with "/api/authors/adam-mickiewicz/kinds/liryka/parent_books/" as e %}
 
  81 If you only want top-level books and not all the children, you can use /parent_books/, as in:
 
  82 <a href="{{e}}">{{e}}</a>.
 
  87 {% url "api_fragment" "sen-nocy-letniej" "1290526312912-3814598192" as f %}
 
  88 {% blocktrans with "/api/authors/william-shakespeare/themes/zabawa/fragments/" as e %}
 
  89 The same way, using also books and themes, you can search for a list of fragments:
 
  90 <a href="{{e}}">{{e}}</a>. 
 
  91 Again, each entry has a "href" attribute which links to the fragment's details, i.e.:
 
  92 <a href="{{f}}">{{f}}</a>.