Korean Medical Tourism Platform

Instagram DM Automation for Hospital Patient Management

🔐 Requesting: pages_messaging Permission

📋 How We Use pages_messaging Permission

What We Do

We subscribe Facebook Pages (connected to Instagram Business accounts) to webhook events to receive real-time message notifications from patients interested in Korean medical tourism.

Why It's Necessary

Without this permission, we cannot call POST /{page-id}/subscribed_apps API to enable webhook subscriptions, which is required to receive Instagram DM notifications in real-time.

Value to Users

Hospital administrators can receive instant notifications when international patients send DM inquiries about medical procedures, enabling 24/7 automated responses and better patient care.

Technical Integration Flow
1
User Logs In
(Facebook OAuth)
→
2
Select Page
(Hospital Page)
→
3
Subscribe
(Webhook API)
→
4
Receive DMs
(Real-time)

Benefits for Hospital Users

✅ Real-time Patient Inquiries: Receive instant notifications when international patients send DMs asking about cosmetic surgery, dental procedures, or health checkups.
✅ 24/7 Automated Response: Enable AI-powered auto-replies to patient questions even outside business hours, improving patient satisfaction.
✅ Centralized Management: Hospital staff can manage DMs from multiple Instagram accounts (11 hospital branches) in one unified dashboard.
✅ Lead Tracking: Store all patient inquiries in database for follow-up and conversion tracking from inquiry to appointment.

đŸŽŦ Live Demo: Subscribe Page to Webhooks

1
Authenticate with Facebook

Permissions requested: pages_show_list, pages_manage_metadata, pages_messaging

4
Send Test Message to Messenger META REVIEW

📋 For Meta App Review Screencast:

  1. Enter Recipient PSID - Use the Page-Scoped ID of the user who messaged your Page
  2. Select Page - Choose the Facebook Page to send from
  3. Type a test message - e.g., "Hello! This is a test from MOA Platform."
  4. Click "Send to Messenger" - Message will be sent via Graph API
  5. Check recipient's Messenger - Verify the message was received

âš ī¸ Please complete Step 1: Facebook Login first to enable Messenger sending.

✅ Expected Result for Screencast:

  • API returns success with message_id
  • Recipient's Messenger app shows the message
  • This demonstrates pages_messaging permission usage

📝 Instructions for Meta Reviewers

1
Click "Login with Facebook" button above to authenticate with your test account. You will be prompted to grant pages_messaging permission.
2
Select a Facebook Page that you manage. The page should be connected to an Instagram Business account.
3
Click "Subscribe to Webhooks" button. This will call POST /{page-id}/subscribed_apps API with subscribed_fields=messages parameter.
4
Verify subscription success. The status will show "✅ Successfully Subscribed" with the subscribed fields displayed.
5
Test webhook delivery: Send a DM to the connected Instagram account. Our webhook endpoint will receive the message event at:
https://win-sns-dm-backend-hhlhhgenaq-du.a.run.app/webhooks/instagram/messages

Technical Information

Webhook Endpoint: https://win-sns-dm-backend-hhlhhgenaq-du.a.run.app/webhooks/instagram/messages
Subscribed Fields: messages
Platform: Google Cloud Run (Seoul Region)
Database: AlloyDB (PostgreSQL)

API Flow:
1. User grants pages_messaging permission
2. App calls POST /{page-id}/subscribed_apps?subscribed_fields=messages
3. Meta sends message events to our webhook endpoint
4. Webhook stores messages in database and triggers auto-response