⚙️ Pengaturan & Integrasi
Konfigurasi webhook, ManyChat, dan koneksi platform
🔗 Webhook Endpoints
Daftarkan URL-URL ini di platform masing-masing untuk menerima pesan masuk secara otomatis.
TikTok
Comment & Mention Webhook
POST /api/webhook/tiktok/comment
Daftarkan di TikTok Developer Portal → Apps → Event Subscriptions →
pilih event
comment.created. Isi Callback URL dengan
https://yourdomain.com/api/webhook/tiktok/commentManyChat
WhatsApp Inbound (via ManyChat Flow)
POST /api/webhook/manychat/inbound
Di ManyChat: buat Flow → tambahkan Action "External Request" →
Method POST → URL:
Body (JSON):
https://yourdomain.com/api/webhook/manychat/inboundBody (JSON):
{ "phone": "{{user phone}}", "fullName": "{{full name}}", "lastInputText": "{{last input text}}", "subscriberId": "{{subscriber id}}" }🤖 Konfigurasi ManyChat API
Edit di appsettings.json atau set sebagai environment variable.
ManyChat:ApiToken
507644••••••••
ManyChat:PageId
5076445
Cara mendapatkan API Token ManyChat
- Login ke app.manychat.com
- Buka Settings → API
- Klik "Generate Access Token"
- Salin token ke
appsettings.json→ManyChat:ApiToken
🗄️ Database MySQL
Connection string di ConnectionStrings:DefaultConnection
Connection String (masked)
Server=localhost;Port=3306;User ID=aspirasi_user;password=••••;Database=aspirasi_subangaspirasi
Perintah EF Core Migration
dotnet ef migrations add InitialCreate
dotnet ef database update
dotnet ef database update
📊 Arsitektur Alur Data
Alur TikTok → Sistem → WhatsApp
🎵 TikTok
Comment/Mention
Comment/Mention
→
⚡ Webhook
POST /tiktok/comment
POST /tiktok/comment
→
🗄️ MySQL
IncomingMessages
IncomingMessages
→
🤖 ManyChat
Send Content API
Send Content API
→
💬 WhatsApp
Subscriber
Subscriber
Alur WhatsApp → Sistem → Notif Subscriber
💬 WhatsApp
Pesan Masuk
Pesan Masuk
→
🤖 ManyChat
Flow Trigger
Flow Trigger
→
⚡ Webhook
POST /manychat/inbound
POST /manychat/inbound
→
🗄️ MySQL
Simpan + Auto-Forward
Simpan + Auto-Forward
→
📲 WA Subscribers
via ManyChat API
via ManyChat API