🤖 Ask Bob AI Documentation

Complete API Reference and Integration Guide

🔐 Authentication

POST /api/auth/login
Authenticate admin users and obtain access token
{
  "email": "admin@askbob.ai",
  "password": "your_password"
}
POST /api/customers/auth/login
Authenticate customer users (multi-tenant)
{
  "email": "customer@business.com",
  "password": "customer_password"
}

💬 Chat & Conversations

POST /api/chat/session
Create a new chat session
POST /api/chat/message
Send a message to the AI chatbot
{
  "session_id": "session_123",
  "message": "Hello, I need help with my order"
}
GET /api/chat/history/:session_id
Retrieve chat conversation history

📊 Analytics & Monitoring

GET /api/analytics/overview
Get system analytics overview
GET /api/health
Check system health status
GET /api/metrics/business
Get business-specific metrics

🏢 Multi-Tenant Customer Management

GET /api/customers/dashboard/:businessId
Get customer dashboard data for specific business
GET /api/customers/analytics/:businessId
Get business analytics for specific customer
GET /api/customers/integration/:businessId/status
Check integration status for business

🎯 UnityXpressions Pilot

GET /api/unityxpressions/dashboard
UnityXpressions pilot dashboard data
GET /api/pilot/metrics/realtime
Real-time pilot performance metrics
GET /api/pilot/feedback/recent
Recent customer feedback from pilot

🎓 Training & Learning

POST /api/training/unityxpressions/analyze
Analyze UnityXpressions business for training
POST /api/training/unityxpressions/quick-setup
Quick setup training for UnityXpressions
GET /api/learning/health
Learning engine health status

🛠️ Integration Examples

// JavaScript fetch example
const response = await fetch('/api/chat/message', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer ' + token
  },
  body: JSON.stringify({
    session_id: sessionId,
    message: userMessage
  })
});

const data = await response.json();
// Python requests example
import requests

response = requests.post(
    'http://localhost:3001/api/chat/message',
    headers={
        'Content-Type': 'application/json',
        'Authorization': f'Bearer {token}'
    },
    json={
        'session_id': session_id,
        'message': user_message
    }
)