{% extends "base.html" %} {% load i18n %} {% load staticfiles %} {% load wger_extras %} {% block title %}{% trans "API key" %}{% endblock %} {% block content %} {% with url='/api/v2/' %}

{% blocktrans %}Generate an API key if you want to interact with wger via the REST API it provides (for public resources such as the exercises or ingredients, you don't need to provide anything). You must pass this information in the header in the format shown below.{% endblocktrans %} {% endwith %}

{% blocktrans %}For security reasons, you should only access the API via HTTPS.{% endblocktrans %}

{% trans "Your API key" %}

{% if token %} {{token.key}} {% else %} {% trans "You have no API key yet" %} {% endif %}
# In the request header
Authorization: Token {% if token %}{{token.key}}{% else %}1234567890abcde...{% endif %}


# Example with curl
curl -X GET https://wger.de/api/v2/workout/ \
     -H 'Authorization: Token {% if token %}{{token.key}}{% else %}1234567890abcde...{% endif %}'
{% endblock %} {% block sidebar %}

{% trans "Options" %}

{% if token %} {% trans 'Delete current API key and generate new one' %} {% else %} {% trans 'Generate new API key' %} {% endif %}

{% trans 'Documentation' %}

{% endblock %}