@include('admin.partials.pro-hero', [
'icon' => 'fas fa-book',
'title' => __('Facebook Webhook Setup Guide'),
'subtitle' => __('Step-by-step webhook configuration'),
'breadcrumbs' => [['label' => __('Dashboard'), 'url' => route('admin.dashboard')], ['label' => __('App Settings'), 'url' => route('admin.chatbot.app-settings.index')], ['label' => __('Webhook Guide'), 'url' => null]],
])
@include('includes.admin.form-error')
@include('includes.admin.form-success')
{{ __('Setup Instructions') }}
{{-- Introduction --}}
What is a Webhook?
Webhooks allow Facebook to send real-time notifications to your server when users interact
with your chatbot (messages, comments, etc.). This guide will help you set up the webhook
connection between Facebook and your application.
{{-- Step-by-step Guide --}}
Setup Steps
{{-- Step 1 --}}
1
Create Facebook App
Go to Facebook Developers
Click "Create App"
Select "Business" as the app type
Fill in your app details and create the app
Add "Messenger" product to your app
{{-- Step 2 --}}
2
Configure App Settings in Admin Panel
Copy your App ID and App Secret from Facebook Developer Dashboard
Go to Facebook App Settings in your admin panel
Paste the App ID and App Secret
Click "Generate" to create a Verify Token
Click "Save Settings"
Click "Test Connection" to verify credentials
Your Webhook Details:
Callback URL:
{{ $webhookUrl }}
Verify Token:
{{ $setting->verify_token ?? 'Not Generated' }}
@if($setting->verify_token)
@endif
{{-- Step 3 --}}
3
Setup Webhook in Facebook
In your Facebook App Dashboard, go to Messenger > Settings
Scroll to "Webhooks" section
Click "Add Callback URL"
Enter the following:
Callback URL: {{ $webhookUrl }}
Verify Token: {{ $setting->verify_token ?? 'Generate first!' }}
Click "Verify and Save"
Important: Make sure your website is accessible via HTTPS and publicly reachable.
Facebook won't be able to verify HTTP URLs or localhost.
{{-- Step 4 --}}
4
Subscribe to Webhook Fields
After webhook verification, subscribe to the following fields:
Messaging Events:
messages - Receive messages from users
messaging_postbacks - Button clicks
message_deliveries - Delivery confirmations
message_reads - Read receipts
Feed Events (Optional):
feed - Page post comments
mention - Page mentions
{{-- Step 5 --}}
5
Connect Facebook Page
In Messenger > Settings , scroll to "Access Tokens"
Click "Add or Remove Pages"
Select the Facebook Page you want to connect
Copy the Page Access Token
Users will use this token to connect their pages in the user panel
{{-- Step 6 --}}
6
Test Your Setup
Send a test message to your Facebook Page
Check if the webhook receives the event (check logs if needed)
Verify that auto-replies are working
Test comment automation on a page post
Success! Your chatbot is now ready to receive and respond to messages!
{{-- Troubleshooting --}}
Troubleshooting
{{-- Issue 1 --}}
Make sure your website is using HTTPS
Check that the Verify Token matches exactly
Ensure your server is publicly accessible (not localhost)
Check server logs for incoming requests from Facebook
{{-- Issue 2 --}}
Verify that webhook fields are subscribed (messages, messaging_postbacks)
Check if the Page is connected to your app
Ensure Page Access Token is valid
Check application logs for errors
{{-- Issue 3 --}}
Double-check your App ID and App Secret
Make sure the app is not in Development Mode with restrictions
Verify Graph API version compatibility
Check if your server can make outbound HTTPS requests
{{-- Action Buttons --}}
@endsection
@section('scripts')
@endsection