{% extends 'base.html' %} {% block title %}Tokeny API{% endblock %} {% block content %}

🔑 Tokeny API

Administrator może utworzyć wiele tokenów, ograniczyć ich zakres i endpointy oraz w każdej chwili je wyłączyć albo usunąć.

📄 Zobacz opis API ← Powrót do panelu
{% include 'admin/_nav.html' %} {% if latest_plain_token %} {% endif %}
➕ Utwórz token
Nazwij token tak, aby było wiadomo do czego służy.
📘 Dokumentacja API
Otwórz TXT
Autoryzacja: Authorization: Bearer TWOJ_TOKEN lub X-API-Token. Endpoint i zakres muszą być jednocześnie dozwolone na tokenie. Parametr limit jest przycinany do wartości ustawionej w tokenie.
{% for row in api_examples %} {% endfor %}
MetodaEndpointWymagany zakresOpis
{{ row.method }} {{ row.path }} {{ row.scope }} {{ row.description }}
📋 Aktywne i historyczne tokeny
{{ api_tokens|length }} szt.
{% for token in api_tokens %} {% else %} {% endfor %}
Nazwa Prefix Status Zakres Endpointy Max limit Utworzono Ostatnie użycie Akcje
{{ token.name }}
Autor: {{ token.creator.username if token.creator else '—' }}
{{ token.token_prefix }}… {% if token.is_active %}Aktywny{% else %}Wyłączony{% endif %} {{ token.scopes or '—' }} {{ token.allowed_endpoints or '—' }} {{ token.max_limit or '—' }} {{ token.created_at.strftime('%Y-%m-%d %H:%M') if token.created_at else '—' }} {{ token.last_used_at.strftime('%Y-%m-%d %H:%M') if token.last_used_at else 'Jeszcze nie użyto' }}
{% if token.is_active %}
{% else %}
{% endif %}
Brak tokenów API.
{% endblock %}