{% extends "base.html" %} {% load i18n static wger_extras %} {% block title %}{% translate "API access" %}{% endblock %} {% block content %}
{% blocktranslate trimmed %} Theare are two ways to authenticate against the API: JWT is the preferred mechanism for client applications, the static API key is intended for personal scripts or one-off integrations. {% endblocktranslate %}
{% blocktranslate trimmed %} Revoking JWT sessions logs out every device that obtained a refresh token via the JWT login endpoint. {% endblocktranslate %}
{% if token %}
{% endif %}
{% blocktranslate with key=token.key|default:"1234567890abcde..." %}
Pass Token {{ key }} in the
Authorization header to use it.
{% endblocktranslate %}
{% translate "Example with curl:" %}
curl -X GET https://wger.de/api/v2/routine/ \
-H 'Authorization: Token {% if token %}{{ token.key }}{% else %}1234567890abcde...{% endif %}'
{% endblock %}
{# #}
{# Sidebar #}
{# #}
{% block sidebar %}