{% extends "base.html" %} {% load i18n staticfiles 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 %}
# 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 %}
{% if token %} {% trans 'Delete current API key and generate new one' %} {% else %} {% trans 'Generate new API key' %} {% endif %}
{% endblock %}