Facebook Publishing

Learn how to connect Facebook Pages and publish various types of content to Facebook.

Connecting Facebook Pages

Prerequisites

Connection Steps

  1. Click the "Connect Facebook Page" button on the dashboard
  2. Log in to Facebook (if not already logged in)
  3. Select the Pages you want to connect to Boring
  4. Review and grant the required permissions:
    • pages_show_list - View your pages
    • pages_read_engagement - Read engagement data
    • pages_manage_posts - Publish and manage posts
    • pages_read_user_content - Read page content
  5. Click "Done" to complete the authorization

Your Facebook Pages will now appear in the Authorized Accounts list with:

Token Information

Supported Content Types

Facebook supports the following post types through Boring:

Type Description Media Count Example
Text Text-only post 0 Status updates, announcements
Photo Single image post 1 Product photo, event poster
Album Multiple images 2-10 Photo gallery, step-by-step guide
Video Video post 1 Tutorial, product demo

Publishing Examples

1. Text-Only Post

{
  "post": {
    "accountId": "your-facebook-page-account-id",
    "content": {
      "text": "Hello from Boring API! This is a text-only post.",
      "mediaUrls": [],
      "platform": "facebook"
    },
    "target": {
      "targetType": "facebook"
    }
  }
}

Result: A simple text post on your Facebook Page.

2. Single Photo Post

{
  "post": {
    "accountId": "your-facebook-page-account-id",
    "content": {
      "text": "Check out this amazing photo!",
      "mediaUrls": ["https://example.com/image.jpg"],
      "platform": "facebook"
    },
    "target": {
      "targetType": "facebook"
    }
  }
}

Result: A post with one image and caption.

Media Requirements:

3. Photo Album (Multi-Image)

{
  "post": {
    "accountId": "your-facebook-page-account-id",
    "content": {
      "text": "Here's a collection of our best moments!",
      "mediaUrls": [
        "https://example.com/photo1.jpg",
        "https://example.com/photo2.jpg",
        "https://example.com/photo3.jpg",
        "https://example.com/photo4.jpg"
      ],
      "platform": "facebook"
    },
    "target": {
      "targetType": "facebook"
    }
  }
}

Result: A photo album post with multiple images.

Album Requirements:

4. Video Post

{
  "post": {
    "accountId": "your-facebook-page-account-id",
    "content": {
      "text": "Watch this incredible video!",
      "mediaUrls": ["https://example.com/video.mp4"],
      "platform": "facebook"
    },
    "target": {
      "targetType": "facebook"
    }
  }
}

Result: A video post with description.

Video Requirements:

API Request Format

Full Example

import requests

API_URL = "https://boring.aiagent-me.com/v2/posts"
API_KEY = "boring_xxxxxxxxxxxxx"
ACCOUNT_ID = "your-facebook-page-account-id"

# Photo album example
post_data = {
    "post": {
        "accountId": ACCOUNT_ID,
        "content": {
            "text": "Summer collection 2025! 🌞",
            "mediaUrls": [
                "https://storage.example.com/summer1.jpg",
                "https://storage.example.com/summer2.jpg",
                "https://storage.example.com/summer3.jpg"
            ],
            "platform": "facebook"
        },
        "target": {
            "targetType": "facebook"
        }
    }
}

headers = {
    "boring-api-key": API_KEY,
    "Content-Type": "application/json"
}

response = requests.post(API_URL, headers=headers, json=post_data)
print(response.json())

Success Response

{
  "success": true,
  "message": "Post published successfully",
  "data": {
    "post_id": "123456789_987654321",
    "post_type": "album",
    "platform": "facebook",
    "page_name": "My Awesome Page",
    "photo_count": 3,
    "published_at": "2025-01-20T10:30:00Z"
  }
}

Media URL Requirements

Hosting Your Media

Media URLs must be:

Recommended Hosting Services

Testing Media URLs

Test your URLs with cURL before publishing:

curl -I https://example.com/image.jpg

Should return:

HTTP/2 200
content-type: image/jpeg
content-length: 123456

Troubleshooting

Common Errors

Error: "Invalid account_id"

Error: "Failed to download media"

Error: "Invalid media type"

Error: "Token expired"

Best Practices

  1. Test with text posts first - Ensure basic setup works
  2. Use reliable media hosting - Avoid temporary URLs
  3. Validate media URLs - Test accessibility before publishing
  4. Keep captions concise - Facebook recommends 1-2 paragraphs
  5. Use high-quality images - Min 1200x630 for best results
  6. Monitor publish history - Check dashboard for errors

Publishing History

View all your Facebook posts in the dashboard:

  1. Sign in to Boring Dashboard
  2. Scroll to "Recent Posts" section
  3. Filter by platform if needed

Each entry shows:

Rate Limits

Facebook API rate limits apply:

Boring handles rate limiting gracefully and returns appropriate errors if limits are reached.

Advanced Features

Multiple Pages

You can connect multiple Facebook Pages to the same Boring account. Each page gets a unique Account ID.

Example workflow:

  1. Connect Page A (get Account ID: aaa-111)
  2. Connect Page B (get Account ID: bbb-222)
  3. Publish to Page A using accountId: "aaa-111"
  4. Publish to Page B using accountId: "bbb-222"

Cross-Platform Publishing

Publish the same content to Facebook, Instagram, and Threads simultaneously:

accounts = [
    "facebook-page-account-id",
    "instagram-account-id",
    "threads-account-id"
]

for account_id in accounts:
    # Adjust content for each platform
    post_data = create_post_data(account_id, platform)
    response = requests.post(API_URL, headers=headers, json=post_data)

Auto-Reply Feature (NEW ✨)

Boring supports automatic comment replies and private messages for Facebook Pages.

Overview

Required Permissions

When connecting your Facebook Page, ensure you grant these permissions:

Setting Up Auto-Reply Rules

  1. Go to Boring Dashboard
  2. Find your Facebook Page in the Authorized Accounts list
  3. Click the "Auto Reply" button
  4. Click "+ Add Rule" to create a new rule:
    • Keyword: The trigger word (e.g., "price", "info", "order")
    • Reply Message: The public comment reply
    • DM Message (optional): Private message sent via Messenger

API Endpoints

List Auto-Reply Rules

GET /api/fb-auto-reply/rules?account_id=YOUR_ACCOUNT_ID

Create Auto-Reply Rule

POST /api/fb-auto-reply/rules
Content-Type: application/json

{
  "account_id": "your-facebook-page-account-id",
  "keyword": "price",
  "reply_message": "Thanks for your interest! Please check our website for pricing.",
  "dm_message": "Hi! Here's a direct link to our pricing page: https://example.com/pricing"
}

Delete Auto-Reply Rule

DELETE /api/fb-auto-reply/rules/{rule_id}

View Auto-Reply Logs

GET /api/fb-auto-reply/logs?account_id=YOUR_ACCOUNT_ID&limit=20

Python Example

import requests

API_URL = "https://boring.aiagent-me.com"
API_KEY = "boring_xxxxxxxxxxxxx"
ACCOUNT_ID = "your-facebook-page-account-id"

headers = {
    "boring-api-key": API_KEY,
    "Content-Type": "application/json"
}

# Create an auto-reply rule
rule_data = {
    "account_id": ACCOUNT_ID,
    "keyword": "discount",
    "reply_message": "Thanks for asking! Use code SAVE10 for 10% off.",
    "dm_message": "Hi! Here's your exclusive discount code: SAVE10"
}

response = requests.post(
    f"{API_URL}/api/fb-auto-reply/rules",
    headers=headers,
    json=rule_data
)
print(response.json())

How It Works

  1. Webhook Setup: When you authorize your Facebook Page, Boring automatically subscribes the page to webhooks
  2. Comment Detection: When someone comments on your Page posts, Facebook sends a webhook notification
  3. Keyword Match: Boring checks if the comment contains any of your configured keywords
  4. Auto Reply: If matched, Boring automatically:
    • Posts a reply to the comment (nested reply)
    • Sends a Private Reply via Messenger (if DM message is configured)
  5. Logging: All actions are logged for review in the dashboard

Limitations

Next Steps