NjanggoNjanggoDocumentation API
Tous

Comment consommer l’API

Guide pas à pas — choisir Plus ou Pro, authentifier, envoyer votre première requête, recevoir un webhook.

Plus ou Pro ?

Vous voulez…PlanCommentAuth
Slack / Zapier / Sheets à chaque inscriptionPlusWebhook → URL ZapierSecret whsec_… (pas de clé API)
Liste d’events sur votre sitePlusWidget iframe (onglet Intégrer)Aucune
Lire events publicsPlusGET /api/calendars/:slug/eventsAucune
Agenda Google à jourPlusFlux ICS (bientôt)Token dans l’URL
Créer des events depuis votre CMSProPOST /api/v1/events (à venir)nj_live_…
Exporter invités / check-in kiosqueProGET export, POST checkinsnj_live_…
Sync ventes vers ERPProGET orders (Bearer aujourd’hui)nj_live_… (cible)
Plus = recevoir et afficher (webhooks, embed). Pro = piloter par code (clés API REST). L’onglet Développeur du dashboard n’est visible que pour les calendriers Plus ou Pro.

Authentification — quel token quand ?

MécanismePlanOù le récupérerUsage
Secret webhook whsec_…PlusCréation webhook (dashboard)Vérifier les POST entrants — pas pour appeler l’API
Bearer ClerkPlus / ProSession njanggo.com (auto)Configurer webhooks, dashboard, Try It!
Clé API nj_live_…ProParamètres → Développeur → Clés APIAutomatisations serveur sur /api/v1/…
AucuneTousLecture publique calendrier / events
Ne confondez pas secret webhook (réception) et clé API (appels sortants). Le plan Plus n’a pas besoin de clé API pour Zapier ou Slack.

URL de base

Production
https://api.njanggo.com/api
Développement local
http://localhost:3001/api

Plus : webhooks et lecture publique sous /api/calendars/… et /api/events/… (sans /v1).

Pro : namespace /api/v1/… avec en-tête x-njanggo-api-key. Gestion des clés : /api/calendars/:slug/api-keys (Bearer dashboard).

Consommer Plus (sans clé API)

  1. 1

    1. Ouvrir le panneau Développeur

    njanggo.com → votre calendrier → Paramètres → Développeur. Requis : plan Plus ou Pro (onglet masqué en Free).

  2. 2

    2. Choisir votre intégration

    Webhook : Gérer l'événement → section Webhooks (aujourd'hui par événement). Site web : onglet Intégrer (iframe calendrier).

  3. 3

    3. Webhook Zapier / Make

    Créez un Catch Hook, collez l'URL dans le webhook, cochez guest.registered, copiez le secret whsec_… (une fois).

  4. 4

    4. Tester

    Bouton Tester dans le dashboard ou inscription test. Votre outil reçoit un POST JSON signé.

Création webhook aujourd’hui (Bearer, par événement) :

curl -X POST "https://api.njanggo.com/api/events/evt_abc123/webhooks" \
  -H "Authorization: Bearer $NJANGGO_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://hooks.zapier.com/hooks/catch/123456/abcdef/","events":["guest.registered"]}'
Cible Plus (calendrier) : POST /api/calendars/:slug/webhooks actuel vs cible. Guide Zapier : Zapier & Make.

Consommer Pro (clé API)

  1. 1

    1. Créer une clé API

    Plan Pro → Paramètres → Développeur → Clés API. Nommez la clé, cochez les scopes minimums, copiez nj_live_… (affichée une seule fois). Max 3 clés actives par calendrier.

  2. 2

    2. Première requête

    En-tête x-njanggo-api-key. Testez avec la fiche calendrier :

  3. 3

    3. Endpoints live

    Aujourd'hui : fiche calendrier, invités, export CSV/JSON, check-ins (lookup + création). CRUD events complet : en cours.

curl -X GET "https://api.njanggo.com/api/v1/calendars/mon-collectif" \
  -H "x-njanggo-api-key: $NJANGGO_API_KEY"
Endpoints /v1 live (juillet 2026)
GET  /api/v1/calendars/:slug              (events:read)
GET  /api/v1/events/:eventId/guests       (guests:read)
GET  /api/v1/events/:eventId/export       (guests:read, ?format=csv|json)
GET  /api/v1/events/:eventId/checkins     (checkins:read)
GET  /api/v1/events/:eventId/checkins/lookup?qrCode=… (checkins:read)
POST /api/v1/events/:eventId/checkins     (checkins:write)
Stockez la clé côté serveur uniquement (Vercel secrets, Railway, .env) — jamais dans le front-end public ou une app mobile distribuée.

Recevoir un webhook (votre serveur)

Njanggo envoie un POST JSON vers votre URL. Format actuel (webhooks par événement) :

En-têteDescription
X-Njanggo-Webhook-EventType : guest.registered, checkin.created, …
X-Njanggo-Webhook-TimestampUnix timestamp (secondes)
X-Njanggo-Webhook-Signaturet=<timestamp>,v1=<hex> — HMAC de "{timestamp}.{body}"
Content-Typeapplication/json
Node.js — vérification (format actuel)
import crypto from 'crypto';

function verifyNjanggoWebhook(rawBody: string, header: string, secret: string) {
  const parts = Object.fromEntries(header.split(',').map((p) => p.trim().split('=')));
  const payload = `${parts.t}.${rawBody}`;
  const expected = crypto.createHmac('sha256', secret).update(payload, 'utf8').digest('hex');
  return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 ?? ''));
}

Cible Plus (webhooks calendrier) : en-têtes X-Njanggo-Event, X-Njanggo-Signature: sha256=…, X-Njanggo-Delivery-Id — voir Webhooks → Signature.

Ce qui est live aujourd’hui

FonctionnalitéStatutChemin / accès
Panneau Développeur dashboard✓ LivePlus & Pro — Paramètres calendrier
Webhooks par événement✓ LivePOST /api/events/:id/webhooks (Bearer)
Widget iframe calendrier✓ LiveOnglet Intégrer (dashboard)
Lecture publique calendrier/events✓ LiveGET /api/calendars/:slug, /events
Clés API Pro (CRUD)✓ LiveGET/POST /api/calendars/:slug/api-keys
API REST /v1 (partiel)✓ LiveCalendrier, guests, export, checkins
Webhooks calendrier◎ CiblePOST /api/calendars/:slug/webhooks
Flux ICS◎ CibleGET /api/calendars/:slug/events.ics
embed.json◎ CibleGET /api/calendars/:slug/embed.json
CRUD events /v1◎ CiblePOST /api/v1/events
Logs webhook Pro◎ CibleGET /api/v1/webhook-deliveries

Table complète : Migration /api → /v1 · Roadmap.

Outils

Playground Try It! sur chaque page endpoint, snippets multi-langages, schémas dans Schémas ressource.