Ana içeriğe geç

AI Connector Service — Webhook ve Proactive Mesajlaşma API Referansı

ProactiveMessageController — /api/proactive-messages

#MethodRouteAuthDescription
1GET/api/proactive-messages?agentId={guid}&page={int}&pageSize={int}RequiredProactive mesaj listesi (PaginatedList<ProactiveMessageDto>)
2POST/api/proactive-messagesRequiredProaktif mesaj oluştur — 201 Created (CreateProactiveMessageCommand: agentId, trigger, payload)
3PUT/api/proactive-messages/{messageId:guid}RequiredMesaj güncelle
4DELETE/api/proactive-messages/{messageId:guid}RequiredMesaj sil

Slack Webhook — /api/webhooks/slack

#MethodRouteAuthDescription
5POST/api/webhooks/slackBot Token (Slack OAuth)Slack incoming mesaj webhook'ı — 200 OK (SlackWebhookHandler → event parse + agent'a yönlendirme)

Request Body:

{
"token": "string (Slack verification token)",
"team_id": "string",
"channel_id": "string",
"user_id": "string",
"text": "string (kullanıcı mesajı)",
"event_ts": "string"
}

Response: { "status": "ok" }


Teams Webhook — /api/webhooks/teams

#MethodRouteAuthDescription
6POST/api/webhooks/teamsBot Token (Teams OAuth)Teams incoming mesaj webhook'ı — 200 OK (TeamsWebhookHandler)

Request Body:

{
"type": "message",
"from": { "user": { "id": "string" } },
"channelId": "string",
"conversation": { "id": "string" },
"text": "string (kullanıcı mesajı)",
"serviceUrl": "string"
}

Telegram Webhook — /api/webhooks/telegram

#MethodRouteAuthDescription
7POST/api/webhooks/telegramBot Token (Telegram Bot API)Telegram update webhook'ı — 200 OK (TelegramWebhookHandler)

Request Body:

{
"update_id": "int",
"message": {
"chat": { "id": "long" },
"from": { "id": "long", "username": "string" },
"text": "string (kullanıcı mesajı)",
"date": "int"
}
}

WhatsApp Webhook — /api/webhooks/whatsapp

#MethodRouteAuthDescription
8POST/api/webhooks/whatsappMeta App TokenWhatsApp Business Cloud API webhook'ı — 200 OK (WhatsAppWebhookHandler)

Request Body:

{
"object": "whatsapp_business_account",
"entry": [{
"id": "string",
"changes": [{
"value": {
"messaging_product": "whatsapp",
"contacts": [{ "wa_id": "string" }],
"messages": [{
"from": "string",
"id": "string",
"timestamp": "string",
"text": { "body": "string (kullanıcı mesajı)" },
"type": "text"
}]
}
}]
}]
}

Widget Chat — /api/widget

#MethodRouteAuthDescription
9GET/api/widget/{widgetId}/configNone (CORS origin whitelist)Widget yapılandırması — 200 OK (WidgetConfigDto)
10POST/api/widget/{widgetId}/session/startNone (rate-limited: 60req/min/IP)Anonim oturum başlatır — 201 Created ({ sessionId: "guid", token: "string" })
11POST/api/widget/{widgetId}/session/otp-verifyNone (rate-limited: 5 attempts/15min)OTP doğrulama oturum — 200 OK ({ sessionId: "guid", verified: true })

Session Modes

ModeAuthTTL
AnonimOturum token (localStorage)2 saat
OTP DoğrulamalıSMS OTP8 saat