{% extends 'base.html.twig' %} {% block title %}API Documentation - E-Ticket{% endblock %} {% block description %}Documentation de l'API E-Ticket pour les organisateurs et l'application scanner.{% endblock %} {% block body %}
{API}
v1.0

API E-Ticket

Documentation complete de l'API REST pour les organisateurs. Gestion des evenements, commandes, billets et scan.

Format

JSON (application/json)

Authentification

ETicket-Email + ETicket-JWT

{% for env in environments %}
{{ env.badge }} {{ env.name }}

https://ticket.e-cosplay.fr{{ env.baseUrl }}

{{ env.description }}

{% endfor %}

L'authentification (/api/auth/login) est commune aux deux environnements : https://ticket.e-cosplay.fr/api/auth/login

Authentification

Toutes les routes (sauf /api/auth/login) necessitent deux headers :

Header Description Exemple
ETicket-Email Email de l'organisateur orga@example.com
ETicket-JWT Token JWT (obtenu via /api/auth/login) eyJhbGciOiJIUzI1NiIs...

Reponse standard

{
  "success": true,
  "data": { ... },
  "error": null
}

Reponse erreur

{
  "success": false,
  "data": null,
  "error": "Message d'erreur explicite"
}
{% for section in sections %}

{{ section.name }}

{% if section.description %}

{{ section.description }}

{% endif %} {% for endpoint in section.endpoints %}
{% set method_colors = { 'GET': 'bg-green-600', 'POST': 'bg-indigo-600', 'PATCH': 'bg-orange-500', 'DELETE': 'bg-red-600', 'PUT': 'bg-yellow-500' } %}
{{ endpoint.method }}
{% if endpoint.path starts with '/api/auth' %} {{ endpoint.path }} {% else %} /api/sandbox|/api/live{{ endpoint.path|replace({'/api': ''}) }} {% endif %}

{{ endpoint.summary }}

{{ endpoint.description }}

{% if endpoint.headers|length > 0 %}

Headers requis

{% for header in endpoint.headers %} {{ header.name }} {% endfor %}
{% endif %} {% if endpoint.params|length > 0 %}

Parametres

{% for name, param in endpoint.params %} {% endfor %}
Nom Type Requis Description
{{ name }} {{ param.type }} {% if param.required %} oui {% else %} non{% if param.default is defined %} ({{ param.default }}){% endif %} {% endif %} {{ param.description }}
{% endif %} {% if endpoint.request %}

Body (JSON)

{
{% for name, field in endpoint.request %}
  "{{ name }}": {{ field.example is defined ? '"' ~ field.example ~ '"' : '"..."' }}{{ not loop.last ? ',' : '' }} // {{ field.type }}{% if field.required %} (requis){% endif %}
{% endfor %}
}
{% endif %} {% if endpoint.response %}

Reponse (200)

{
{% for name, field in endpoint.response %}
  "{{ name }}": {{ field.example }} // {{ field.type }}{{ not loop.last ? ',' : '' }}
{% endfor %}
}
{% endif %} {% if endpoint.statuses|length > 0 %}

Codes de reponse

{% for code, desc in endpoint.statuses %} {% set code_color = code < 300 ? 'border-green-600 text-green-700 bg-green-50' : (code < 400 ? 'border-yellow-500 text-yellow-700 bg-yellow-50' : (code < 500 ? 'border-red-600 text-red-700 bg-red-50' : 'border-gray-600 text-gray-700 bg-gray-50')) %}
{{ code }} {{ desc }}
{% endfor %}
{% endif %}
{% endfor %}
{% endfor %}

Rate Limiting

L'API est limitee a 60 requetes par minute par cle API. En cas de depassement, un code 429 est retourne.

Headers de rate limit

X-RateLimit-Limit Nombre max de requetes par fenetre
X-RateLimit-Remaining Requetes restantes dans la fenetre courante
Retry-After Secondes avant la prochaine fenetre (si 429)
{% endblock %}