Exemples — Public API
Snippets prêts à copier pour tester l'API.
Scripts curl
Tous les scripts attendent STORMEO_API_KEY exporté en variable d'environnement. Optionnel : STORMEO_API_BASE (défaut https://beta.stormeo.io/api/public/v1).
bash
export STORMEO_API_KEY=spk_votre_clef_48_hex| Script | Description | Scopes requis |
|---|---|---|
| curl/00-getting-started.sh | /me + /scopes + /health — sanity check | (aucun) |
| curl/01-clients-crud.sh | CRUD complet (create → read → update → delete) | clients:* |
| curl/02-invoices-create-mark-paid.sh | Workflow facture draft → sent → paid | invoices:write,read |
| curl/03-webhooks-subscribe-and-test.sh | Souscription webhook + test ping + historique | webhooks:manage |
| curl/04-rate-limit-monitoring.sh | Boucle de monitoring de la consommation | (aucun) |
Postman
Une collection Postman est disponible : postman.json (à venir — exporter la collection depuis Postman après import des endpoints documentés).
Variables Postman à configurer :
:https://beta.stormeo.io/api/public/v1: votre cléspk_*: un ID de client existant pour les exemples qui en ont besoin
Insomnia / Bruno / HTTPie
Les scripts curl sont directement portables :
bash
# httpie
http GET "$STORMEO_API_BASE/clients" "x-api-key: $STORMEO_API_KEY"
# xh (httpie en Rust, plus rapide)
xh GET "$STORMEO_API_BASE/clients" "x-api-key: $STORMEO_API_KEY"