3.1 KiB
3.1 KiB
Meta (Facebook & Instagram) API Setup Guide
This guide provides step-by-step instructions for setting up Meta Graph API integration for managing Facebook Pages and Instagram Business accounts.
Table of Contents
- Overview
- Prerequisites
- Meta for Developers Setup
- Environment Configuration
- OAuth Redirect URI Configuration
- Permissions & Scopes
- Webhook Configuration
- Development vs Production
- Troubleshooting
Overview
API Version: Graph API v24.0
Base URL: https://graph.facebook.com/v24.0
Auth URL: https://www.facebook.com/v24.0/dialog/oauth
Features Supported
-
Facebook Pages:
- Fetch page posts
- Read comments on posts
- Reply to comments as the Page
-
Instagram Business:
- Fetch Instagram media posts
- Read comments on posts
- Reply to comments (with nesting limitations)
How It Works
- User authenticates with Facebook
- App discovers all Facebook Pages the user manages
- For each Page, app also discovers linked Instagram Business accounts
- Page Access Tokens are permanent (don't expire if app is active)
Prerequisites
- A Facebook account with admin access to at least one Facebook Page
- An Instagram Business Account linked to your Facebook Page
- Access to Meta for Developers
- HTTPS-enabled server for production
Linking Instagram to Facebook Page
- Go to your Facebook Page settings
- Navigate to Instagram → Connect Account
- Log in to your Instagram Business account
- Authorize the connection
Meta for Developers Setup
Step 1: Create a Meta App
- Navigate to Meta for Developers
- Click "Create App"
- Select "Business" as the app type
- Fill in the details:
- App Name: Your application name (e.g., "PX360 Social Manager")
- App Contact Email: Your contact email
- Business Account: Select your business (if applicable)
- Click "Create App"
- Complete security verification if prompted
Step 2: Configure Basic Settings
- Go to "Settings" → "Basic"
- Fill in required fields:
- Privacy Policy URL: Your privacy policy URL
- User Data Deletion: Provide deletion instructions or URL
- Category: Select "Business Tools"
- Add App Domains (your application's domain)
- Click "Save Changes"
Step 3: Add Facebook Login Product
- Go to "Add Products" (left sidebar)
- Find "Facebook Login" and click "Set Up"
- Select "Web" as platform
- Enter your site URL
- Configure OAuth settings (see Redirect URI section below)
Step 4: Get App Credentials
- Go to "Settings" → "Basic"
- Copy the following:
- App ID → This is your
META_APP_ID - App Secret → Click "Show" → This is your
META_APP_SECRET
- App ID → This is your
⚠️ Important: Never expose your App Secret in client-side code.