Skip to main content
This documentation describes the Facebook Messenger integration with AGO, allowing your customers to interact with AGO agents directly from Facebook Messenger.

Overview

The Facebook Messenger integration supports:
  • Receiving messages from your Facebook Pages
  • Message processing by AGO agents
  • Text messages with support for long responses (auto-split at 2000 characters)
  • Media messages (images, documents, audio, video)
  • Secure webhook validation with HMAC-SHA256

Prerequisites

Before setting up the integration, you need:
  1. Facebook Page: A Facebook Page that you manage with admin access
  2. OAuth Link: A connection link provided by the AGO team

Setup Guide

1

Request Access from AGO Team

Contact the AGO team to receive your OAuth connection link. This link will allow you to authorize your Facebook Page to work with AGO.
2

Authorize Your Facebook Page

  1. Click on the OAuth link provided by AGO
  2. Log in to Facebook if not already logged in
  3. Select the Facebook Page(s) you want to connect
  4. Grant the required permissions (messaging permissions)
  5. Complete the authorization flow
3

Verify the Connection in AGO

  1. Log in to your AGO Admin panel
  2. Navigate to Settings > Integrations > Messenger
  3. Your connected page(s) should appear in the list
  4. Verify the connection status shows “Connected”
4

Assign an Agent (Optional)

  1. In the Messenger integration page, find your connected page
  2. Click Assign Agent
  3. Select the agent that should handle messages from this page
  4. Click Update Agent

Supported Message Types

Incoming Messages (From Users)

Outgoing Messages (From AGO)

Features

Long Message Handling

Facebook Messenger has a 2000 character limit per message. AGO automatically splits longer responses intelligently:
  • Prioritizes splitting at paragraph breaks
  • Falls back to sentence endings
  • Then word boundaries

Agent Assignment

You can assign specific agents to each Facebook Page:
  • Messages are routed to the assigned agent
  • If no agent is assigned, the default agent handles messages
  • Change agent assignments anytime in the admin panel

Message Queuing

When users send multiple messages rapidly (within 2 seconds), AGO:
  • Queues the messages
  • Merges them into a single request
  • Provides a unified response
This prevents fragmented conversations and improves response quality.

Human Takeover Detection

AGO automatically detects when a human operator responds on the Facebook Page:
  • If a human replies from the Page, AGO pauses automated responses
  • This prevents duplicate or conflicting responses
  • Normal operation resumes when the human conversation ends

Troubleshooting

Page Not Appearing After Authorization
  • Ensure you have admin access to the Facebook Page
  • Try the authorization flow again
  • Contact AGO support if the issue persists
Messages Not Being Processed
  • Check that the page is marked as “Connected” in AGO
  • Verify an agent is assigned to the page
  1. Go to Settings > Integrations > Messenger
  2. Check the status badge on each page:
    • OAuth Connected: Page is working
    • Webhook Active: Webhook is properly receiving events
    • Webhook Inactive: Contact AGO support

Security

The Messenger integration includes several security measures:
  • Webhook Signature Validation: All incoming webhooks are validated using HMAC-SHA256
  • Encrypted Token Storage: Page access tokens are encrypted at rest
  • OAuth Flow: Secure authorization via Facebook’s official OAuth flow

Limitations

  • Only one AGO tenant can connect each Facebook Page (unique constraint)
  • Interactive message templates are not currently supported
  • Only text responses are supported (no images or documents from AGO)

Support

If you encounter issues:
  1. Check the troubleshooting section above
  2. Contact the AGO team with your Page name and any error messages