Skip to Content
Wagoo SaaS 1.0.25 is released 🎉
04 API ReferenceAPI Reference

API Reference

Référence complète de l’API REST Wagoo SaaS.

Base URL

http://localhost:3000/api (Développement) https://wagoo.app/api (Production)

Authentification

Toutes les requêtes protégées nécessitent un token Bearer :

curl http://localhost:3000/api/projects \ -H "Authorization: Bearer YOUR_TOKEN"

Voir Authentification pour obtenir un token.

Conventions

RequĂŞte

METHOD /api/resource/{id} Content-Type: application/json Authorization: Bearer TOKEN

Réponse (2xx)

{ "data": { ... }, "meta": { "total": 10 } }

Erreur (4xx/5xx)

{ "error": "Unauthorized", "message": "Token invalid", "code": "AUTH_ERROR" }

Status codes

CodeSignification
200OK - Succès
201Created - Créé
204No Content - Pas de contenu
400Bad Request - RequĂŞte invalide
401Unauthorized - Non authentifié
403Forbidden - Accès refusé
404Not Found - Non trouvé
429Too Many Requests - Rate limité
500Internal Server Error - Erreur serveur

Pagination

GET /api/projects?page=1&limit=10

Réponse :

{ "data": [...], "meta": { "total": 100, "page": 1, "limit": 10, "pages": 10 } }

Filtrage

GET /api/articles?status=PUBLISHED&projectId=proj_123

Tri

GET /api/articles?sort=createdAt&order=desc

Sections API

  1. Authentification - Sign in, Sign up, Sessions
  2. Projets - CRUD Projets et membres
  3. Blog - Articles et gestion de contenu
  4. Avis - Récupérer et modérer les avis
  5. Festivals - Gestion des événements
  6. Tickets - Support et demandes
  7. Administration - Admin API
  8. Webhooks - Intégrations Stripe

Erreurs courantes

401 Unauthorized

Token invalide ou expiré. Reconnectez-vous.

curl -X POST http://localhost:3000/api/auth/sign-in \ -d '{"email": "...", "password": "..."}'

403 Forbidden

Permission insuffisante. Vous devez être propriétaire du projet.

404 Not Found

Resource n’existe pas ou n’a pas accès.

429 Too Many Requests

Rate limité. Attendez avant de recommencer.

Rate Limiting

  • Endpoints publics : 100 req/min
  • Endpoints authentifiĂ©s : 1000 req/min
  • Webhooks : Pas de limite

Headers :

X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 999 X-RateLimit-Reset: 1234567890

Exemples avec cURL

Tous les exemples utilisent cURL, mais fonctionnent avec n’importe quel client HTTP.

Avec Token

# Stocker le token TOKEN="YOUR_TOKEN" # Utiliser le token curl http://localhost:3000/api/projects \ -H "Authorization: Bearer $TOKEN"

Avec jq (parser JSON)

curl http://localhost:3000/api/projects \ -H "Authorization: Bearer $TOKEN" | jq '.data'

SDKs

Wagoo fournit des SDKs (Ă  venir) pour :

  • JavaScript/TypeScript
  • Python
  • Go

Voir aussi

Last updated on