{% extends "base.html" %} {% block title %}API Tokens - Fixture Manager{% endblock %} {% block extra_css %} /* Modal styles */ .modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); } .modal.show { display: flex; align-items: center; justify-content: center; } .modal-dialog { background: white; border-radius: 8px; max-width: 500px; width: 90%; max-height: 90vh; overflow-y: auto; box-shadow: 0 4px 20px rgba(0,0,0,0.3); } .modal-header { padding: 1rem; border-bottom: 1px solid #ddd; display: flex; justify-content: space-between; align-items: center; background-color: #f8f9fa; border-radius: 8px 8px 0 0; } .modal-header.bg-success { background-color: #28a745; color: white; } .modal-title { margin: 0; font-size: 1.2rem; font-weight: bold; } .modal-body { padding: 1rem; } .modal-footer { padding: 1rem; border-top: 1px solid #ddd; display: flex; justify-content: flex-end; gap: 0.5rem; background-color: #f8f9fa; border-radius: 0 0 8px 8px; } .close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #666; padding: 0; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; } .close-btn:hover { color: #000; } .close-btn.white { color: white; } .close-btn.white:hover { color: #ccc; } /* Form styles */ .form-label { display: block; margin-bottom: 0.5rem; font-weight: bold; color: #333; } .form-control { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-size: 1rem; } .form-control:focus { outline: none; border-color: #007bff; } .form-control[readonly] { background-color: #f8f9fa; font-family: monospace; } .form-text { font-size: 0.875rem; color: #666; margin-top: 0.25rem; } .form-select { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-size: 1rem; background-color: white; } /* Input group */ .input-group { display: flex; } .input-group .form-control { border-radius: 4px 0 0 4px; border-right: none; } .input-group .btn { border-radius: 0 4px 4px 0; border-left: 1px solid #007bff; } /* Card styles */ .card { background: white; border: 1px solid #ddd; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); margin-bottom: 1rem; } .card-header { padding: 1rem; background-color: #f8f9fa; border-bottom: 1px solid #ddd; border-radius: 8px 8px 0 0; } .card-header.bg-info { background-color: #17a2b8; color: white; } .card-body { padding: 1rem; } /* Table styles */ .table-responsive { overflow-x: auto; } .table-hover tbody tr:hover { background-color: #f8f9fa; } /* Badge styles */ .badge { display: inline-block; padding: 0.25rem 0.5rem; font-size: 0.75rem; font-weight: bold; border-radius: 4px; color: white; } .badge.bg-success { background-color: #28a745; } .badge.bg-danger { background-color: #dc3545; } .badge.bg-secondary { background-color: #6c757d; } /* Button group */ .btn-group { display: inline-flex; gap: 2px; } .btn-outline-warning { background-color: transparent; color: #ffc107; border: 1px solid #ffc107; } .btn-outline-warning:hover { background-color: #ffc107; color: #212529; } .btn-outline-info { background-color: transparent; color: #17a2b8; border: 1px solid #17a2b8; } .btn-outline-info:hover { background-color: #17a2b8; color: white; } .btn-outline-danger { background-color: transparent; color: #dc3545; border: 1px solid #dc3545; } .btn-outline-danger:hover { background-color: #dc3545; color: white; } .btn-outline-secondary { background-color: transparent; color: #6c757d; border: 1px solid #6c757d; } .btn-outline-secondary:hover { background-color: #6c757d; color: white; } /* Utility classes */ .mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; } .text-muted { color: #666; } .font-monospace { font-family: monospace; } .py-5 { padding-top: 3rem; padding-bottom: 3rem; } .fa-3x { font-size: 3rem; } /* Hide elements by default */ .d-none { display: none; } /* Success message styling */ .success-message { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; padding: 12px; border-radius: 4px; margin-bottom: 1rem; } /* Warning message styling */ .warning-message { background-color: #fff3cd; color: #856404; border: 1px solid #ffeaa7; padding: 12px; border-radius: 4px; margin-bottom: 1rem; } /* Danger message styling */ .danger-message { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; padding: 12px; border-radius: 4px; margin-bottom: 1rem; } {% endblock %} {% block content %}

🔑 API Tokens

Manage your API tokens for external application access

â„šī¸ API Usage

Base URL: {{ request.url_root }}api/

Authentication: Include your token in the Authorization header:

Authorization: Bearer YOUR_TOKEN_HERE

Available Endpoints:

  • GET /api/fixtures - List all fixtures
  • GET /api/matches - List all matches
  • GET /api/match/<id> - Get match details
Your API Tokens
{% if tokens %}
{% for token in tokens %} {% endfor %}
Name Status Created Expires Last Used Actions
{{ token.name }} {% if token.is_valid() %} Active {% elif token.is_expired() %} Expired {% else %} Revoked {% endif %} {{ token.created_at.strftime('%Y-%m-%d %H:%M') }} {{ token.expires_at.strftime('%Y-%m-%d %H:%M') }} {% if token.last_used_at %} {{ token.last_used_at.strftime('%Y-%m-%d %H:%M') }} {% if token.last_used_ip %}
from {{ token.last_used_ip }} {% endif %} {% else %} Never used {% endif %}
{% if token.is_active and not token.is_expired() %} {% endif %}
{% else %}
🔑
No API tokens yet

Create your first API token to start accessing the API

{% endif %}
{% endblock %}