Self hosted FLOSS fitness/workout, nutrition and weight tracker
Don't translate the technical API documentation
Roland Geiderd4525dedba1d
diff --git a/wger/software/templates/api.html b/wger/software/templates/api.htmlindex 8943050e2..84d5a591f 100644--- a/wger/software/templates/api.html+++ b/wger/software/templates/api.html@@ -1,37 +1,35 @@{% extends "base.html" %}-{% load i18n %}{% load staticfiles %}{% load wger_extras %}-{% block title %}{% trans "REST API" %}{% endblock %}+{% block title %}REST API{% endblock %}{% block content %}-{% with link='href="/api/v1/?format=json" rel="nofollow"' %}-<p>{% blocktrans %}wger Workout Manager provides a full REST API to all database-objects:{% endblocktrans %} <a {{link}}>https://wger.de/api/v1/</a></p>-{% endwith %}+<p>wger Workout Manager provides a full REST API to all database+objects: <a href="/api/v1/?format=json" rel="nofollow">https://wger.de/api/v1/</a></p>-<p>{% blocktrans %}The API uses HATEOAS, so you should be able to browse+<p>The API uses HATEOAS, so you should be able to browsethrough the necessary endpoints without having to consult an extensivedocumentation. At the moment, the API only supports read operations, but-support for full POST/PUT/DELETE/PATCH is planned for the near future.{% endblocktrans %}</p>+support for full POST/PUT/DELETE/PATCH is planned for the near future.</p>-<p>{% blocktrans %}You should always use HTTPS if possible when communicating-with the server.{% endblocktrans %}</p>+<p>You should always use HTTPS if possible when communicating+with the server.</p>-<h3>{% trans "Authentication" %}</h3>-<p>{% blocktrans %}Public endpoints, such as the list of exercises or the+<h3>Authentication</h3>+<p>Public endpoints, such as the list of exercises or theingredients can be accessed without authentication. For <strong>user ownedobjects such as workouts, you need to generate an API KEY</strong> and passit along with the username either in the header or in form of GET parameters.-See the link on the sidebar for details.{% endblocktrans %}</p>+See the link on the sidebar for details.</p>-<h3>{% trans "Fetching Data" %}</h3>++<h3>Fetching Data</h3><!--Many of the explanations are taken fromhttps://django-tastypie.readthedocs.org/en/latest/interacting.html@@ -42,13 +40,13 @@ https://django-tastypie.readthedocs.org/en/latest/interacting.htmlcurl https://wger.de/api/v1/ | python -m json.tool</code>-<p>{% blocktrans %}This lists out all the different resources available. Each+<p>This lists out all the different resources available. Eachone is listed by the resource_name and provides the list_endpoint and the schemafor the resource. Note that these links try to direct you to other parts of the-API, to make exploration/discovery easier.{% endblocktrans %}</p>+API, to make exploration/discovery easier.</p>-<h4>{% trans "Getting A Collection Of Resources" %}</h4>+<h4>Getting A Collection Of Resources</h4><code>curl https://wger.de/api/v1/exercise/ | python -m json.toolcurl https://wger.de/api/v1/exercise/schema/ | python -m json.tool@@ -56,18 +54,18 @@ curl https://wger.de/api/v1/exercise/schema/ | python -m json.tool<ul>- <li>{% trans "By default, you get a paginated set of objects" %}</li>- <li>{% trans "In the meta, you get a previous and next. If available, these are URIs to the previous and next pages." %}</li>- <li>{% trans "You get a list of resources/objects under the objects key." %}</li>- <li>{% trans "Each resources/object has a resource_uri field that points to the detail view for that object." %}</li>- <li>{% trans "Foreign keys are represented as URIs." %}</li>+ <li>By default, you get a paginated set of objects</li>+ <li>In the meta, you get a previous and next. If available, these are URIs to the previous and next pages.</li>+ <li>You get a list of resources/objects under the objects key.</li>+ <li>Each resources/object has a resource_uri field that points to the detail view for that object.</li>+ <li>Foreign keys are represented as URIs.</li></ul><code>curl https://wger.de/api/v1/exercise/1/ | python -m json.tool</code>-<p>{% blocktrans %}This simply returns the exercise resource with the ID 1.{% endblocktrans %}</p>+<p>This simply returns the exercise resource with the ID 1.</p><code>curl https://wger.de/api/v1/foobar/1/?bar=baz | python -m json.tool@@ -75,19 +73,19 @@ curl https://wger.de/api/v1/exercise/set/1;3/ | python -m json.toolcurl https://wger.de/api/v1/exercise/?offset=20&limit=20 | python -m json.tool</code>-<p>{% blocktrans %}You can filter the resources, assuming that bar is an+<p>You can filter the resources, assuming that bar is anattribute of foobar. Alternatively you can just specify the IDs you need or-provide an offset.{% endblocktrans %}</p>+provide an offset.</p>{% endblock %}{% block sidebar %}<div class="alert alert-info" style="margin-top:1em;">-{% blocktrans %}This is also new for us, if you plan on using the API,-<a href="https://groups.google.com/group/wger">we'd love to hear from you</a>.{% endblocktrans %}+This is also new for us, if you plan on using the API,+<a href="https://groups.google.com/group/wger">we'd love to hear from you</a>.</div>-<p><a href="/api/v1/?format=json" class="btn btn-block" rel="nofollow">{% trans "Browse the API" %}</a></p>+<p><a href="/api/v1/?format=json" class="btn btn-block" rel="nofollow">Browse the API</a></p><p><a href="{% url 'api-key' %}" class="btn btn-block">Generate API KEY</a></p>{% endblock %}