Portail développeur WazzyAI
Une API REST simple, deux SDKs (JavaScript + Python), un système de webhooks signés, et un catalogue de plugins pour étendre la plateforme.
🚀 Quickstart
- Créez une clé API depuis Développeurs
- Envoyez-la dans l'en-tête
Authorization: Bearer wzy_... - Base URL :
https://votre-domaine/api/v1
curl https://your-domain.com/api/v1/me \ -H "Authorization: Bearer wzy_xxxxxxxx_yyyyyyyyyyyyyyyyy"
📖 Endpoints
/v1/me/v1/contacts/v1/contacts/v1/conversations/v1/conversations/{id}/messages/v1/conversations/{id}/messages🔒 Rate limit : 120 req/min/IP. Scopes disponibles : read, write, admin.
📦 SDKs officiels
@wazzyai/sdknpm install @wazzyai/sdk
import { WazzyClient } from "@wazzyai/sdk";
const wazzy = new WazzyClient({ apiKey: "wzy_..." });
const me = await wazzy.me();
const contacts = await wazzy.contacts.list({ limit: 10 });
await wazzy.conversations.sendMessage(conversationId, "Bonjour !");⬇ Télécharger le SDKwazzyaipip install wazzyai
from wazzyai import WazzyClient wazzy = WazzyClient(api_key="wzy_...") me = wazzy.me() contacts = wazzy.contacts.list(limit=10) wazzy.conversations.send_message(conversation_id, "Bonjour !")⬇ Télécharger le SDK
💡 Les SDKs consomment /api/v1 — ils marchent avec toute clé WazzyAI et n'ont aucune dépendance à Node/Prisma.
🪝 Webhooks
Configurez une URL depuis Développeurs → Webhooks. Nous POSTons un JSON signé HMAC-SHA256 dans l'en-tête x-wazzy-signature.
const crypto = require('crypto');
function verify(body, signature, secret) {
const expected = 'sha256=' + crypto.createHmac('sha256', secret).update(body).digest('hex');
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(signature));
}🔁 Retry avec backoff exponentiel : 10s → 1m → 5m → 30m → 2h (5 tentatives).
Événements : message.in, message.out, lead.stage_change, notification, conversation.update, *.
🧩 Plugins
Étendez WazzyAI avec des extensions JavaScript qui hookent sur les événements de votre organisation. Publiez le vôtre en soumettant un pull request sur notre registry public.
module.exports = {
hooks: {
async onIncomingMessage(ctx, { text, contactId, conversationId }) {
if (/urgent/i.test(text)) {
await ctx.actions.handoff();
await ctx.actions.notify({ title: "🚨 Urgent détecté", body: text.slice(0, 100) });
}
}
}
};