{% extends "base.html" %} {% load i18n %} {% load staticfiles %} {% load wger_extras %} {% block title %}{% trans "API key" %}{% endblock %} {% block content %}
{% 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 together with your username either in the header or in the request as GET parameters. For example:{% endblocktrans %}
# In header Authorization: ApiKey {{user.username}}:{% if key %}{{key.key|truncatechars:15}}{% else %}1234567890abcde...{% endif %} # In GET parameter https://wger.de/api/v1/workout/?username={{user.username}}&api_key={% if key %}{{key.key|truncatechars:15}}{% else %}1234567890abcde...{% endif %}
{% trans "Your API key" %} | {% if key %} {{key.key}} {% else %} {% trans "You have no API key yet" %} {% endif %} |
{% trans "Your username" %} | {{user.username}} |
{% if key %} {% trans 'Delete current API key and generate new one' %} {% else %} {% trans 'Generate new API key' %} {% endif %}
{% endblock %}