API אחד לשלוח ולקבל הודעות מ-WhatsApp, Messenger, Instagram, Telegram ואימייל. מחובר — ה-API מנתב אוטומטית לערוץ הנכון.
קבל את ה-spec המלא, בנה client, ושלח הודעות בלי לקרוא docs.
// 1. AIFLOW שולח POST לשרת שלך עם כל event
// ה-platform.replyEndpoint מוכן — אין צורך לדעת איזה ערוץ
async function handleAiflowWebhook(event) {
const { platform, data } = event;
const userMessage = data?.message || data?.text || '';
// 2. שלח ל-LLM שלך
const reply = await yourLLM.generate(userMessage);
// 3. ענה דרך replyEndpoint — נתוב אוטומטית לערוץ הנכון
await fetch(platform.replyEndpoint.url, {
method: 'POST',
headers: {
'Authorization': platform.replyEndpoint.auth, // "Bearer <api_key>"
'Content-Type': 'application/json',
},
body: JSON.stringify({ type: 'text', text: reply }),
});
}platform.replyEndpoint קיים בכל webhook event — אין צורך לשמור channel, instanceId, PSID או bot token בצד שלך.שני endpoints עיקריים. 5 דקות מאתחול ל-"הודעה ראשונה נשלחה".
# 1. קבל API key מ-/settings/webhooks
# 2. קבל instanceId מ-/settings/whatsapp-unofficial (UUID, לא idInstance)
curl -X POST https://flow.txi.co.il/api/external/send \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "972501234567",
"instanceId": "YOUR_INSTANCE_UUID",
"type": "text",
"text": "הודעה ראשונה!"
}'
# Response: { "ok": true, "messageId": "...", "channel": "whatsapp_green" }# conversationId מגיע ב-webhook event או מ-GET /api/external/conversations
curl -X POST https://flow.txi.co.il/api/external/conversations/CONV_ID/reply \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "type": "text", "text": "תודה, נחזור אליך!" }'
# עובד אוטומטית עם: WhatsApp, Messenger, Instagram, Telegram, GmailAIFLOW מאפשרת למערכות חיצוניות — כמו CRM, קול-סנטר, או bot AI — לשלוח ולקבל הודעות בשם העסק שלך, על כל הערוצים שחיברת, בלי לעבור דרך הממשק הגרפי.