Dashboard

Account Overview
Connected

Username: @username

Followers: 0

Auto-Reply Status: Active

Documents Trained: 0

Messages Processed: 0

AI System Status: Inactive

Recent Auto-Replies

No recent replies yet.

Quick Actions

AI Training

Upload Training Documents

Upload Word, Excel, or PDF files that contain information about your business, products, services, FAQs, and common inquiries.

Upload

Drag and drop files here or

Training Status

No documents have been trained yet.

AI Activation Requirements

To activate the AI system, you need:

  • OpenAI API Key (configure in Settings → AI Settings)
  • At least one training document uploaded
  • Click "Activate AI" button in Dashboard

Response Templates

Customize AI Response Style
Default Response Style
Test AI Response

Response will appear here...

Settings

Instagram Account
Profile

@username

0 followers

AI Settings
Your API key is securely handled in accordance with our privacy policy.
Enable developer mode to access advanced help and setup documentation. Password required.
Auto-Reply Settings
Add a delay before responding to make interactions appear more natural.
Webhook Configuration
What are webhooks?

Webhooks allow Instagram to send real-time notifications to your server when events occur, such as when someone sends a message to your account.

This is your webhook endpoint hosted on muffaddalaiweb.shop
This token helps Instagram verify your endpoint.
Built-in Webhook Server Ready

Your software now includes a built-in webhook server that can receive Instagram events directly. No external services required!

  • Webhook URL: https://muffaddalaiweb.shop/instagram-webhook.php
  • Real-time message processing
  • Automatic AI response generation
  • Event logging and history
Server Status: Stopped
Webhook Setup Instructions
Important Setup Steps

To complete your webhook setup with Instagram:

  1. Start the webhook server using the button above
  2. Copy your webhook URL: https://muffaddalaiweb.shop/instagram-webhook.php
  3. Copy your verify token from the field above
  4. Go to Facebook Developer Portal:
    • Navigate to your app → Products → Webhooks
    • Click "Configure" next to Instagram
    • Enter your webhook URL and verify token
    • Subscribe to "messages" events
  5. Test the integration by sending a message to your Instagram account

System Status & Diagnostics

🔧 Dashboard Button Issues - FIXED
Dashboard Button Functionality Restored

Issue: The four dashboard buttons (Activate AI, Toggle Auto-Reply, Test AI Response, Upload New Document) were not working due to missing event handlers.

🔧 Fixes Applied:
  • ✅ Added missing toggleAutoReply() function for auto-reply toggle
  • ✅ Implemented showTestAIModal() for Test AI Response button
  • ✅ Fixed upload document button to redirect to AI Training section
  • ✅ Enhanced Activate AI button with proper validation and status updates
  • ✅ Added proper button state management and visual feedback
📋 Button Functions Now Working:
  1. Activate AI: Validates API key and training documents, then activates AI system
  2. Toggle Auto-Reply: Switches auto-reply on/off and updates status display
  3. Test AI Response: Opens modal for testing AI with your uploaded documents
  4. Upload New Document: Redirects to AI Training section for file uploads
How to Use Dashboard Buttons

Correct Order of Operations:

  1. Upload Documents: Use "Upload New Document" or go to AI Training section
  2. Configure API Key: Add OpenAI API key in Settings → AI Settings
  3. Activate AI: Click "Activate AI" button (will validate requirements)
  4. Test AI: Use "Test AI Response" to verify AI is working with your data
  5. Enable Auto-Reply: Toggle auto-reply to start responding to Instagram messages
Button Requirements
  • Activate AI: Requires OpenAI API key + at least 1 training document
  • Test AI Response: Requires AI system to be activated first
  • Toggle Auto-Reply: Works independently, but AI responses need activated AI system
  • Upload New Document: Always available, redirects to training section
🔍 Instagram Login Status Explanation
Understanding Login Warnings

The warnings you're seeing are normal when you haven't logged in yet:

  • "Instagram Access Token: Missing" - This means you haven't connected your Instagram account yet
  • "Instagram User ID: Missing" - Your Instagram user ID isn't stored because login hasn't completed
  • "Instagram Username: Missing" - Your Instagram username isn't stored yet
  • "App Login State: Not Logged In" - The application knows you're not logged in
  • "Auth Client State: Not Authenticated" - The authentication system is waiting for you to log in
How to Fix This
  1. Click "Connect Instagram" on the dashboard
  2. Authorize the app when Instagram prompts you
  3. Return to this page - the callback should happen automatically
  4. Check network tab for exchange-token.php requests
  5. You should see a success popup with your account details
Troubleshooting Login Issues

If login isn't working properly:

  • Make sure you're using the correct Instagram account
  • Check that popup blockers aren't interfering
  • Clear browser cache and cookies
  • Try using an incognito/private browser window
  • Monitor the Network tab in developer tools for API calls
  • The exchange-token.php should trigger after Instagram redirects back
What Happens During Login
  1. OAuth Redirect: You're sent to Instagram's authorization page
  2. User Authorization: You grant permissions to the app
  3. Callback: Instagram redirects back with an authorization code
  4. Token Exchange: exchange-token.php converts the code to an access token
  5. Storage: Your tokens and user info are stored locally
  6. Success: You should see all warnings change to green checkmarks
🔧 System Overview
Software Architecture

Modular design with focused components for maintainability.

  • Core Application: Main app logic and initialization
  • Authentication: Instagram OAuth integration
  • AI Training: Document processing and OpenAI integration
  • Webhook Handler: Real-time message processing
  • File Parser: Multi-format document extraction
  • Utilities: Helper functions and shared components
🔧 System Debug Console
[SYSTEM] Instagram login troubleshooting system loaded