TheVoĉoTheVoĉo

Facebook Page Connection

Connect your Facebook business page to receive and respond to Messenger messages in your Cloud-PBX unified inbox.

Overview

Facebook Messenger Authentication connects your Facebook business page to Cloud-PBX using Facebook's Messenger Platform API.

Requirements:

  • Facebook business page (not personal profile)
  • Page administrator access
  • Facebook App with Messenger permissions
  • Webhook endpoint for receiving messages

Configuration Steps

Verify Page Administrator Access

Ensure you have admin access to the Facebook page:

  1. Go to your Facebook page
  2. Click Settings (left sidebar)
  3. Click Page Roles
  4. Verify you're listed as Admin

If not admin, request access from current page admin.

Admin Access Required

You must be a page administrator to connect Messenger to Cloud-PBX.

Enable Messenger on Your Page

Activate Messenger for your Facebook page:

  1. Go to Page Settings → Messaging
  2. Toggle Allow people to contact my Page privately to ON
  3. Review and configure Messenger settings:
    • Response time
    • Away message
    • Instant replies
  4. Save changes

Your page can now receive messages!

Create Facebook App (if needed)

Cloud-PBX needs a Facebook App to access Messenger API:

Option A: Use Cloud-PBX Managed App (Recommended):

  • Cloud-PBX provides pre-configured Facebook App
  • Simpler setup process
  • Skip to Step 4

Option B: Create Your Own Facebook App:

  1. Go to developers.facebook.com
  2. Click My Apps → Create App
  3. Select Business as app type
  4. Fill details:
    • App Name: "Your Business - Messaging"
    • Contact Email: Your email
    • Business Account: Select or create
  5. Click Create App
  6. In app dashboard, click Add Product
  7. Find Messenger and click Set Up
  8. App is now ready for configuration

Connect Page to Cloud-PBX

Link your Facebook page:

  1. Navigate to Messaging → Facebook → Authentication
  2. Click Connect Facebook Page
  3. Facebook login window opens
  4. Log in with Facebook account (page admin)
  5. Select page(s) to connect
  6. Grant permissions:
    • Manage and access Page conversations in Messenger
    • Read content posted on the Page
    • Show a list of the Pages you manage
  7. Click Continue
  8. Page appears in Cloud-PBX as connected

Page Connected

Your Facebook page is now connected to Cloud-PBX!

Configure Webhooks

Cloud-PBX automatically configures webhooks, but verify:

  1. In Cloud-PBX, go to Messaging → Facebook → Webhooks
  2. Verify webhook status: Active
  3. Webhook URL: https://your-pbx-domain.com/api/messaging/facebook/webhook

Webhook Events Subscribed:

  • messages - Incoming messages
  • messaging_postbacks - Button clicks
  • messaging_optins - Opt-in events
  • message_deliveries - Delivery confirmations
  • message_reads - Read receipts

Manual Webhook Setup (if using your own Facebook App):

  1. Go to Facebook App dashboard
  2. Navigate to Messenger → Settings
  3. In Webhooks section, click Add Callback URL
  4. Callback URL: https://your-pbx-domain.com/api/messaging/facebook/webhook
  5. Verify Token: Copy from Cloud-PBX (Settings → Facebook → Webhook Token)
  6. Click Verify and Save
  7. Subscribe to webhook events (list above)
  8. Save configuration

Test Integration

Verify end-to-end messaging:

Inbound Test:

  1. From your personal Facebook account, go to your business page
  2. Click Message button
  3. Send test message: "Testing Cloud-PBX integration"
  4. Verify message appears in Cloud-PBX inbox
  5. Check message details (sender, timestamp, content)

Outbound Test:

  1. In Cloud-PBX inbox, click on test conversation
  2. Type reply: "Test successful!"
  3. Send message
  4. Verify reply appears in Facebook Messenger (your personal account)
  5. Check for read receipts

Feature Test:

  1. Send image from Facebook Messenger
  2. Verify image appears in Cloud-PBX
  3. Reply with quick reply buttons from Cloud-PBX
  4. Verify buttons appear in Facebook Messenger

Integration Complete

Facebook Messenger is fully operational!

Configure Page Settings (Optional)

Optimize Messenger experience:

  1. Go to Messaging → Facebook → Page Settings
  2. Greeting Text: Customize welcome message
    • Example: "Hi! Thanks for contacting us. How can we help today?"
  3. Response Time: Display expected response time
    • Options: Minutes, Hours, A day, A few days
  4. Away Message: Configure after-hours message
    • Enable during closed hours
    • Example: "Thanks for your message! We're currently closed but will respond tomorrow."
  5. Instant Reply: Auto-response to first message
    • Example: "Thanks for reaching out! An agent will be with you shortly."
  6. Save settings

Page Access Token

What is Page Access Token?

  • Authentication credential for API access
  • Allows Cloud-PBX to send/receive messages on behalf of your page
  • Generated when you connect page
  • Stored securely in Cloud-PBX

Token Management:

  • Automatic Renewal: Cloud-PBX refreshes tokens automatically
  • Expiration: Tokens typically valid for 60 days (then auto-refreshed)
  • Manual Refresh: Reconnect page if issues arise
  • Security: Never share token publicly

Token Permissions:

  • pages_messaging - Send and receive messages
  • pages_read_engagement - Read page content
  • pages_manage_metadata - Manage page settings

Webhook Security

Webhook Verification:

  • Facebook signs webhook requests with SHA-256 signature
  • Cloud-PBX validates signature automatically
  • Prevents spoofing and unauthorized access
  • Only accepts requests from Facebook IPs

Security Best Practices:

  • Use HTTPS only (never HTTP)
  • Validate all webhook signatures
  • Implement rate limiting
  • Log all webhook activity
  • Monitor for suspicious patterns
  • Keep webhook URL private

Multiple Pages

Connect Multiple Facebook Pages:

If you manage multiple Facebook pages:

  1. Go to Messaging → Facebook → Pages
  2. Click Add Page
  3. Repeat authentication process
  4. Select additional page
  5. Page added to list

Per-Page Configuration:

  • Each page has separate routing rules
  • Independent auto-responses
  • Separate analytics
  • Different agent assignments

Page Switching:

  • Agents see all pages in unified inbox
  • Filter by page if needed
  • Page name/logo shown on each message
  • Reply automatically uses correct page

App Review (if using your own Facebook App)

Development vs Live Mode:

  • Development: Only admins can use
  • Live: Public can message page

Switching to Live Mode:

  1. Go to Facebook App dashboard
  2. Navigate to App Review → Permissions and Features
  3. Request review for:
    • pages_messaging
    • pages_manage_metadata
  4. Provide:
    • App purpose
    • Privacy policy URL
    • Terms of service URL
    • Use case description
  5. Submit for review
  6. Approval typically 3-5 business days
  7. Once approved, toggle app to Live mode

Cloud-PBX Managed App

If using Cloud-PBX's managed Facebook App, it's already in Live mode. No app review needed!


Troubleshooting

Can't Connect Page:

  • Verify you're page administrator (not editor or moderator)
  • Check page is published (not draft)
  • Ensure Messenger enabled on page
  • Try different browser or clear cache
  • Verify Facebook account not restricted

Webhook Not Receiving Messages:

  • Check webhook status in Cloud-PBX (should be "Active")
  • Verify webhook URL publicly accessible (HTTPS)
  • Test webhook URL with Facebook's test tool
  • Review webhook logs for errors
  • Confirm subscribed to correct events
  • Check SSL certificate valid

Page Access Token Invalid:

  • Reconnect page to refresh token
  • Verify page still exists and not deleted
  • Check admin access not revoked
  • Review Facebook App status (not disabled)
  • Token may have expired (reconnect)

Messages Delayed:

  • Check webhook response time (must be under 20 seconds)
  • Verify server performance (not overloaded)
  • Review Facebook platform status (possible outage)
  • Check network connectivity
  • Increase webhook timeout if needed

Permission Denied Errors:

  • Reconnect page to refresh permissions
  • Verify all required permissions granted
  • Check Facebook App approved (if using own app)
  • Review app restrictions or limits
  • Contact Facebook support if persists

Disconnecting a Page

To Disconnect Facebook Page:

  1. Go to Messaging → Facebook → Pages
  2. Find page to disconnect
  3. Click Disconnect
  4. Confirm disconnection
  5. Page removed from Cloud-PBX

What Happens:

  • Cloud-PBX stops receiving messages
  • Conversation history preserved (read-only)
  • Page continues functioning normally on Facebook
  • Can reconnect anytime

Reconnecting:

  • Follow same authentication process
  • Previous settings may need reconfiguration
  • Conversation history remains

Security & Privacy

Data Handling:

  • Message content encrypted in transit and at rest
  • Customer data handled per privacy policy
  • Comply with GDPR, CCPA requirements
  • Message retention configurable
  • Audit logs track all access

Access Control:

  • Role-based permissions in Cloud-PBX
  • Limit who can view/respond to messages
  • Monitor agent activity
  • Revoke access when needed

Facebook Privacy:

  • Follow Facebook Community Standards
  • Respect customer privacy
  • Don't share customer data inappropriately
  • Provide clear privacy policy
  • Handle data deletion requests

Next Steps

Authentication Complete

Facebook Messenger is connected! Configure settings and routing next.

  1. Configure Settings: Set up auto-responses and greeting in Facebook Settings
  2. Create Routing: Route messages to appropriate teams in Message Queues
  3. Train Team: Familiarize agents with Messenger features
  4. Promote: Let customers know they can message your page
  5. Monitor: Track response time and customer satisfaction