Connect Your Instagram
Automate replies to your Instagram DMs with AI

Connect your Instagram account to start automating your replies.
This tool requires your Instagram login. Your credentials are securely handled in accordance with our privacy policy.
Dashboard
Account Overview
ConnectedUsername: @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.

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

@username
0 followers
AI Settings
Auto-Reply Settings
Webhook Configuration
Webhooks allow Instagram to send real-time notifications to your server when events occur, such as when someone sends a message to your account.
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
Webhook Setup Instructions
Important Setup Steps
To complete your webhook setup with Instagram:
- Start the webhook server using the button above
- Copy your webhook URL:
https://muffaddalaiweb.shop/instagram-webhook.php
- Copy your verify token from the field above
- 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
- 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:
- Activate AI: Validates API key and training documents, then activates AI system
- Toggle Auto-Reply: Switches auto-reply on/off and updates status display
- Test AI Response: Opens modal for testing AI with your uploaded documents
- Upload New Document: Redirects to AI Training section for file uploads
How to Use Dashboard Buttons
Correct Order of Operations:
- Upload Documents: Use "Upload New Document" or go to AI Training section
- Configure API Key: Add OpenAI API key in Settings → AI Settings
- Activate AI: Click "Activate AI" button (will validate requirements)
- Test AI: Use "Test AI Response" to verify AI is working with your data
- 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
- Click "Connect Instagram" on the dashboard
- Authorize the app when Instagram prompts you
- Return to this page - the callback should happen automatically
- Check network tab for exchange-token.php requests
- 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
- OAuth Redirect: You're sent to Instagram's authorization page
- User Authorization: You grant permissions to the app
- Callback: Instagram redirects back with an authorization code
- Token Exchange: exchange-token.php converts the code to an access token
- Storage: Your tokens and user info are stored locally
- 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