Important: You must have a Facebook Page to use Messenger integration. The Page will be the identity through which your AI responds to users.
đ˘ Table of Contents
- Create a Meta Business Account
- Create a Meta App and Enable Messenger
- Generate a Page Access Token
- Configure Webhooks in the Meta App
- Connect Your Meta App to ZappWay
- Final Checks and Monitoring
1. Create a Meta Business Account
- Navigate to https://business.facebook.com.
- Click âCreate Account.â
- Fill out the required information:
- Business Name
- Your Full Name
- Work Email
- Continue through the prompts to finalize setup. When prompted:
- Add a Facebook Page (you can use an existing page or create a new one).
- Add a Payment Method if requested.
- Complete Business Verification by submitting the necessary documents (e.g., company registration, proof of address).
Tip: Meta may limit certain features on new accounts until you complete the verification process. Follow all on-screen instructions and provide any additional documents requested.
2. Create a Meta App and Enable Messenger
- Go to https://developers.facebook.com/apps.
- Click âCreate App.â
- When prompted âWhat do you want your app to do?â, select âOther.â
- Choose âBusinessâ as your app type.
- Complete the form by providing:
- App Name (for example, âZappWay Messenger Botâ)
- Contact Email
- Link to the Meta Business Account you created in Step 1.
- Click âCreate App.â
- Inside your newly created Appâs dashboard, locate the âProductsâ section.
- Select â+ Add Product.â
- Find âMessengerâ in the list, and click âSet Up.â
Note:
- If Meta requests additional business verification at this stage, complete that process before proceeding.
- Ensure you are working under the correct Business Manager account.
3. Generate a Page Access Token
The Page Access Token authenticates your integration and allows ZappWay to send and receive messages on behalf of your Facebook Page.3.1 Generate Token in Meta App Dashboard
- In your Meta App, navigate to Messenger â Settings.
- Under âAccess Tokensâ section, youâll see your connected Facebook Pages.
- Select the Page you want to use for this integration.
- Click âGenerate Tokenâ.
- A modal will appear asking for permissions - accept all required permissions.
- Copy the generated Page Access Token immediately and store it securely.
CRITICAL: Token Expiration
- By default, Page Access Tokens expire after 60 days.
- To create a never-expiring token, you must:
- Create a System User in Business Manager
- Assign the System User to your App with âManage Appâ permission
- Generate a token from the System User (select âNeverâ for expiration)
- We recommend using never-expiring tokens for production use.
3.2 Verify Token Permissions
Your token must have these permissions:- pages_messaging - Send and receive messages
- pages_manage_metadata - Manage page metadata
- pages_read_engagement - Read page engagement data
- pages_show_list - Access list of pages
https://developers.facebook.com/tools/debug/accesstoken/
4. Configure Webhooks in the Meta App
Webhooks allow Meta to send incoming messages to ZappWay in real-time.4.1 Set Up Webhook URL
- In your Meta Appâs Messenger settings, locate the âWebhooksâ section.
- Click âAdd Callback URLâ (or âEdit Callback URLâ if one exists).
- Youâll need two pieces of information from ZappWay (obtained in Step 5):
- Callback URL:
https://app.zappway.ai/api/integrations/messenger/webhook?service_provider_id=<SERVICE_PROVIDER_ID> - Verify Token: A unique string generated by ZappWay
- Callback URL:
Note: Youâll get these values after creating the integration in ZappWay (Step 5), so you may need to come back to this step.
4.2 Subscribe to Webhook Fields
After verifying the callback URL, subscribe to these webhook fields:- â messages - Receive incoming messages
- â messaging_postbacks - Receive button clicks and postbacks
- â messaging_optins - Receive opt-in events
- â message_deliveries - Track message delivery status
- â message_reads - Track when messages are read
5. Connect Your Meta App to ZappWay
Follow these steps within the ZappWay dashboard to complete the integration.Step 1: Requirements
- Log in to your ZappWay dashboard.
- Navigate to Integrations â Messenger.
- Click âAdd Messenger Integration.â
- Review the requirements and click âContinue.â
Step 2: Page Access Token
- Paste the Page Access Token you generated in Step 3.
- Click âContinue.â
- ZappWay will validate the token by making a request to Metaâs Graph API.
- The system will automatically detect your Page ID and Page Name.
- If validation fails, verify that your token is valid and has the required permissions.
Step 3: Page Selection
- ZappWay will display the detected Page Name and Page ID.
- If this is correct, click âContinue.â
- If you need to use a different page:
- Generate a new token for that page in the Meta App dashboard
- Return to Step 2 with the new token
Step 4: Webhook Configuration
ZappWay will display two values you need to configure in Meta:- Callback URL (example:
https://app.zappway.ai/api/integrations/messenger/webhook?service_provider_id=abc123) - Verify Token (a unique string generated by ZappWay)
- Copy these values.
- Return to your Meta Appâs Messenger settings (Step 4).
- Paste the Callback URL and Verify Token.
- Click âVerify and Saveâ in the Meta dashboard.
- Ensure all webhook fields are subscribed (messages, messaging_postbacks, etc.).
- Return to ZappWay and click âFinish.â
6. Final Checks and Monitoring
6.1 Verify Connection Status
- In ZappWayâs Integrations page, the Messenger integration should show âConnectedâ status.
- The Page Name should be displayed correctly.
6.2 Test Message Flow
- Open Messenger and send a test message to your Facebook Page.
- Verify that the message appears in ZappWayâs Inbox.
- Check that your AI Employee responds according to configured rules.
If Messages Donât Arrive:
- Verify the webhook callback URL is correctly configured in Meta
- Check that webhook fields are subscribed (especially âmessagesâ)
- Review webhook logs in Meta App dashboard for delivery errors
- Ensure your Page Access Token hasnât expired
6.3 Monitor for Common Issues
Token Expiration (401 Unauthorized):- Page Access Tokens can expire after 60 days
- Use a System User token for never-expiring access
- Update the token in ZappWay before expiration
- Verify that Callback URL and Verify Token match exactly
- Check that ZappWayâs servers are accessible from Metaâs IPs
- Review Meta App dashboard webhook logs for error details
- Verify Page Access Token permissions
- Check rate limits in Meta App dashboard
- Review ZappWay logs for API errors
- Meta may flag your Page if too many users block or report it
- Ensure your AI responses are helpful and appropriate
- Avoid sending unsolicited messages
6.4 Rate Limits
- Messenger has rate limits based on your appâs verification level
- Standard rate limit: 200 API calls per hour per user
- Higher limits available after app verification
- Monitor usage in Meta App dashboard
â Best Practices
Security
- Never share your Page Access Token publicly
- Store tokens in environment variables or secrets manager
- Rotate tokens periodically (every 60 days minimum)
- Use System User tokens for production environments
Compliance
- Follow Metaâs Platform Policies and Messenger Platform Policy
- Obtain user consent before sending messages
- Provide clear opt-out mechanisms
- Respect user preferences and privacy
User Experience
- Keep response times under 3 seconds
- Provide helpful, contextual responses
- Use quick replies for common actions
- Implement typing indicators for longer responses
Monitoring
- Set up alerts for webhook failures
- Monitor message delivery rates
- Track user engagement metrics
- Review error logs regularly
đ Useful Links
- Messenger Platform Documentation: https://developers.facebook.com/docs/messenger-platform
- Graph API Reference: https://developers.facebook.com/docs/graph-api
- Page Access Tokens: https://developers.facebook.com/docs/facebook-login/guides/access-tokens/get-long-lived
- Webhook Reference: https://developers.facebook.com/docs/messenger-platform/webhooks
- Platform Policies: https://developers.facebook.com/docs/messenger-platform/policy-overview
Need Help? If you encounter issues during setup, contact ZappWay support or visit our documentation at docs.zappway.ai

