Skip to content

Latest commit

 

History

History
241 lines (197 loc) · 9.68 KB

File metadata and controls

241 lines (197 loc) · 9.68 KB

Platform Connectivity Summary

This document provides a quick reference for all platform integrations in Web3AI.

Architecture Overview

┌─────────────────────────────────────────────────────────────────┐
│                         Web3AI Backend                          │
│                       (FastAPI + Python)                        │
├─────────────────────────────────────────────────────────────────┤
│                                                                 │
│  ┌──────────────┐  ┌──────────────┐  ┌──────────────┐         │
│  │   ManyChat   │  │ BotBuilders  │  │  OpenClaw    │         │
│  │ Integration  │  │ Integration  │  │ Integration  │         │
│  └──────┬───────┘  └──────┬───────┘  └──────┬───────┘         │
│         │                 │                  │                  │
│         └─────────────────┼──────────────────┘                  │
│                           │                                     │
│                    ┌──────┴───────┐                            │
│                    │   MoltBook   │                            │
│                    │ Integration  │                            │
│                    └──────────────┘                            │
│                                                                 │
│  ┌──────────────────────────────────────────────────────────┐ │
│  │              Core Web3AI Features                        │ │
│  │  • AI/LLM Integration (OpenAI)                           │ │
│  │  • Blockchain Integration (Web3.py)                      │ │
│  │  • Smart Contract Support                                │ │
│  └──────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
        ┌─────────────────────────────────────┐
        │   External Platforms & Services     │
        ├─────────────────────────────────────┤
        │  • Facebook Messenger (ManyChat)    │
        │  • WhatsApp (ManyChat)              │
        │  • Instagram (ManyChat)             │
        │  • Web/Mobile Bots (BotBuilders)    │
        │  • Custom Channels                  │
        └─────────────────────────────────────┘

Integration Capabilities Matrix

Feature ManyChat BotBuilders OpenClaw MoltBook
Webhooks
Send Messages
User Management
Tag/Label Support
Session Management
Conversation Mgmt
Quick Replies
Cards/Carousel
Media Messages
Interactive Buttons
Multi-participant
Signature Verification

Endpoint Summary

ManyChat Endpoints (8 total)

  • GET /integrations/manychat/ - Integration info
  • POST /integrations/manychat/webhook - Receive messages
  • POST /integrations/manychat/send-message - Send message
  • GET /integrations/manychat/subscriber/{id} - Get subscriber
  • POST /integrations/manychat/tag/add - Add tag
  • POST /integrations/manychat/tag/remove - Remove tag

BotBuilders Endpoints (8 total)

  • GET /integrations/botbuilders/ - Integration info
  • POST /integrations/botbuilders/webhook - Receive messages
  • POST /integrations/botbuilders/send-message - Send message
  • GET /integrations/botbuilders/user/{id} - Get user
  • POST /integrations/botbuilders/user/properties - Update properties
  • POST /integrations/botbuilders/session/create - Create session
  • POST /integrations/botbuilders/session/end - End session

OpenClaw Endpoints (9 total)

  • GET /integrations/openclaw/ - Integration info
  • POST /integrations/openclaw/webhook - Receive messages
  • POST /integrations/openclaw/send-message - Send message
  • POST /integrations/openclaw/session/create - Create session
  • GET /integrations/openclaw/session/{id} - Get session
  • POST /integrations/openclaw/session/update - Update session
  • POST /integrations/openclaw/session/close - Close session
  • GET /integrations/openclaw/session/{id}/history - Get history

MoltBook Endpoints (11 total)

  • GET /integrations/moltbook/ - Integration info
  • POST /integrations/moltbook/webhook - Receive messages
  • POST /integrations/moltbook/send-message - Send message
  • POST /integrations/moltbook/conversation/create - Create conversation
  • GET /integrations/moltbook/conversation/{id} - Get conversation
  • GET /integrations/moltbook/conversation/{id}/messages - Get messages
  • POST /integrations/moltbook/conversation/participant/add - Add participant
  • POST /integrations/moltbook/conversation/participant/remove - Remove participant
  • GET /integrations/moltbook/user/{id} - Get user
  • POST /integrations/moltbook/user/status - Update status

Total: 36 new API endpoints across 4 platforms

Use Cases

ManyChat - Social Media Marketing

  • Automated responses on Facebook Messenger
  • WhatsApp business communication
  • Instagram DM automation
  • Customer support chatbots
  • Lead generation and qualification

BotBuilders - Custom Bot Development

  • Multi-channel bot deployment (web, mobile, messaging)
  • User property tracking and personalization
  • Session-based conversation flows
  • Intent and entity recognition support
  • Card and carousel message types

OpenClaw - Conversational AI

  • Long-running conversation sessions
  • Context-aware dialogue management
  • Conversation history tracking
  • Action-based responses
  • Rich content delivery

MoltBook - Team Messaging

  • Multi-participant conversations
  • Media sharing (images, videos, files)
  • User presence and status
  • Participant management
  • Reaction support

Security Features

All integrations include:

  1. HMAC-SHA256 Signature Verification

    • Validates webhook authenticity
    • Prevents unauthorized access
    • Configurable via environment variables
  2. Request Validation

    • Pydantic models for all requests
    • Type checking and validation
    • Automatic error responses
  3. CORS Configuration

    • Configured for localhost development
    • Customizable for production
  4. Environment-based Configuration

    • Secrets stored in .env files
    • Never committed to source control
    • Easy rotation and management

Testing Coverage

  • Unit Tests: 14 integration tests
  • All Tests: 23 total (including existing tests)
  • Code Coverage: Full coverage of integration routes
  • Test Categories:
    • Webhook handling
    • Message sending
    • User/subscriber management
    • Session management
    • Conversation management

Quick Start Commands

# Run all tests
cd backend && pytest -v

# Run only integration tests
cd backend && pytest tests/test_integrations.py -v

# Run specific platform tests
cd backend && pytest tests/test_integrations.py::test_manychat_webhook -v

# Start development server
cd backend && uvicorn app.main:app --reload

# View API documentation
# Navigate to http://localhost:8000/docs

Environment Configuration

Minimal configuration in backend/.env:

# Required only if using the specific platform
MANYCHAT_API_KEY=
MANYCHAT_WEBHOOK_SECRET=

BOTBUILDERS_API_TOKEN=
BOTBUILDERS_WEBHOOK_SECRET=

OPENCLAW_API_KEY=
OPENCLAW_WEBHOOK_SECRET=

MOLTBOOK_API_TOKEN=
MOLTBOOK_WEBHOOK_SECRET=

Future Enhancements

Potential additions to consider:

  1. AI Processing Pipeline

    • Automatic AI response generation using OpenAI
    • Context-aware conversation handling
    • Sentiment analysis
  2. Blockchain Integration

    • Token-gated access to bot features
    • NFT verification for premium features
    • On-chain conversation logging
  3. Additional Platforms

    • Telegram integration
    • Discord integration
    • Slack integration
    • Microsoft Teams integration
  4. Advanced Features

    • Rate limiting
    • Message queuing
    • Webhook retry logic
    • Analytics and reporting

Support & Documentation

  • Detailed Documentation: See INTEGRATIONS.md
  • API Reference: http://localhost:8000/docs (when server is running)
  • Source Code:
    • Integration modules: backend/app/integrations/
    • API routes: backend/app/routes/
    • Tests: backend/tests/test_integrations.py