Facebook Publishing
Learn how to connect Facebook Pages and publish various types of content to Facebook.
Connecting Facebook Pages
Prerequisites
- A Facebook account
- Admin access to at least one Facebook Page
- Signed in to Boring Dashboard
Connection Steps
- Click the "Connect Facebook Page" button on the dashboard
- Log in to Facebook (if not already logged in)
- Select the Pages you want to connect to Boring
- Review and grant the required permissions:
pages_show_list- View your pagespages_read_engagement- Read engagement datapages_manage_posts- Publish and manage postspages_read_user_content- Read page content
- Click "Done" to complete the authorization
Your Facebook Pages will now appear in the Authorized Accounts list with:
- Page name
- Platform badge (Facebook)
- Unique Account ID (click "Copy ID" to get it)
- Disconnect option
Token Information
- Token Type: Long-lived Page Access Token
- Expiration: Never expires
- Data Access: Valid for 90 days (requires re-authorization after)
- Auto-refresh: Not needed
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:
- Format: JPG, PNG
- Max size: 4MB recommended
- Aspect ratio: Any (1:1 recommended)
- URL: Must be publicly accessible
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:
- Min images: 2
- Max images: 10
- All images must be valid URLs
- Formats: JPG, PNG
- Max size per image: 4MB recommended
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:
- Format: MP4, MOV
- Max size: 1GB
- Max duration: 240 minutes
- Aspect ratio: 16:9 or 9:16 recommended
- URL: Must be publicly accessible
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:
- Publicly accessible (no authentication required)
- Direct file URLs (not HTML pages)
- HTTPS (HTTP will be upgraded automatically)
- Valid and active (404s will cause errors)
Recommended Hosting Services
- Google Cloud Storage (public buckets)
- AWS S3 (public buckets)
- Cloudinary
- Imgur
- Your own web server with public access
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"
- Cause: Account ID doesn't exist or belongs to different user
- Solution: Copy the correct Account ID from dashboard
Error: "Failed to download media"
- Cause: Media URL is not accessible
- Solution:
- Verify URL is publicly accessible
- Check URL returns correct content-type
- Ensure no authentication required
Error: "Invalid media type"
- Cause: File format not supported
- Solution: Convert to JPG/PNG for images or MP4 for videos
Error: "Token expired"
- Cause: Data access permissions expired (90 days)
- Solution: Reconnect Facebook Page from dashboard
Best Practices
- Test with text posts first - Ensure basic setup works
- Use reliable media hosting - Avoid temporary URLs
- Validate media URLs - Test accessibility before publishing
- Keep captions concise - Facebook recommends 1-2 paragraphs
- Use high-quality images - Min 1200x630 for best results
- Monitor publish history - Check dashboard for errors
Publishing History
View all your Facebook posts in the dashboard:
- Sign in to Boring Dashboard
- Scroll to "Recent Posts" section
- Filter by platform if needed
Each entry shows:
- Post type (text, photo, album, video)
- Content preview
- Status (published/failed)
- Timestamp
- Error message (if failed)
Rate Limits
Facebook API rate limits apply:
- Page: 200 calls/hour per page
- User: 200 calls/hour per user
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:
- Connect Page A (get Account ID:
aaa-111) - Connect Page B (get Account ID:
bbb-222) - Publish to Page A using
accountId: "aaa-111" - 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)
Next Steps
- Instagram Publishing - Learn about Instagram
- Threads Publishing - Learn about Threads
- API Reference - Complete API documentation
- Examples - More code examples