Facebook Pages
Facebook Page posts use the official Pages API. Nothing is posted by automating facebook.com. A group post is not sent. Meta removed the Groups API, including publish_to_groups, on April 22, 2024. That removal is in the Graph API v19.0 changelog.
Checked against the Pages posts guide, the comments guide, and the video publishing guide.
What you can send
Section titled “What you can send”| Kind | Rule |
|---|---|
| Text | The Page post text, up to 63,206 characters |
| Link | One https URL, with optional text. The card comes from the URL. |
| Photo | One to ten images. JPEG, PNG, WebP, or GIF, up to 10 MB each. |
| Video | One MP4, up to 256 MB and 20 minutes |
| Group post | Prepared here, then posted by a person in the group. See Handoff-only posts. |
The person who connects the Page needs the CREATE_CONTENT task on that Page. If they manage more than one Page, the connection names the Pages and asks them to choose one.
A first comment is posted on the Page post after Facebook accepts it. Reading other people’s comments is on Inbox and listening. Direct messages are not requested.
Set up the Meta app
Section titled “Set up the Meta app”- Open developers.facebook.com/apps and create an app.
- Add Facebook Login and the Pages use case.
- Add the redirect URI exactly:
{APP_PUBLIC_ORIGIN}/api/connect/facebook/callback. - Request
pages_show_list,pages_read_engagement,pages_manage_posts,pages_manage_engagement,pages_read_user_engagement, andpublish_video. Do not requestpublish_to_groupsor Messenger. - Submit those permissions in App Review. Until they are approved, only people with a role on the app can connect a Page. The screencast should show connecting a Page, publishing a post, and reading a comment.
- After approval, switch the app to Live.
- Put the app id and secret in
FACEBOOK_CLIENT_IDandFACEBOOK_CLIENT_SECRET. - Set
FACEBOOK_HTTP_ALLOW_NETWORK=1only on the server that may callgraph.facebook.com. SetFACEBOOK_GRAPH_VERSIONif the app is not onv27.0.
A short-lived user token is exchanged for a long-lived user token of about 60 days. The Page token used for publishing comes from that user token. Refresh mints a new Page token while the user token is still valid.