Page Content

This guide explains how to create and update a post or comment, reply to a post or comment, and delete a post or comment, on your Facebook Page Feed as the Page.

Publish a Page Post

To publish a post on a Page, send a POST request to the /{page-id}/feed endpoint.

Before You Start

You will need the following:

Sample Request

curl -i -X POST "https://graph.facebook.com/{page-id}/feed
  ?message=Hello Fans!
  &access_token={page-access-token}"

On success, your app receives the following response:

{
  "id": "{page-post-id}" 
}

The post is published immediately.

See Also

Publish a Link

To publish a link on a Page, send a POST request to the /{page-id}/feed endpoint and include the link parameter.

Sample Request

curl -i -X POST "https://graph.facebook.com/{page-id}/feed
  ?message=Smart video calling to fit every family
  &link=https://portal.facebook.com/products/
  &access_token={page-access-token}"

On success, your app receives the following response:

{
  "id": "{page-post-id}"
}

Publish a Photo

To publish a photo on a Page, send a POST request to /{page-id}/photos endpoint.

Sample Request

curl -i -X POST "https://graph.facebook.com/{page-id}/photos
    ?url={path-to-photo}
    &access_token={page-access-token}"

On success, your app receives the following response:

{
  "id":"{photo-id}",                        
  "post_id":"{page-post-id}"    
}

See Also

Publish a Video

To publish a video on a Page, send a POST request to /{page-id}/videos endpoint.

Additional Requirements

Sample Request

curl -i -X POST "https://graph.facebook.com/{page-id}/videos"    

On success, your app receives the following response:

{
  "id":"{video-id}"   
}

See Also

Get Page Posts

To get a list of Page posts, send a GET request to the /{page-id}/feed endpoint.

Before You Start

For people who manage the Page being queried, you will need the following:

For people who do not manage the Page being queried, you will need:

Sample Request

curl -i -X GET "https://graph.facebook.com/{page-id}/feed
     ?access_token={access-token}"

On success, your app receives the following response:

{
  "data": [
    {
      "created_time": "2019-01-02T18:31:28+0000",
      "message": "This is my test post on my Page.",
      "id": "{page-post-id}"
    }
  ],
...

Limitations

  • Live Videos - If a Page post contains a video that has expired, such as a live broadcast, you can get some post fields but not fields related to the video. The video has its own privacy rules. If the video has expired, you must be the page admin to view its information.
  • Message CTA - Any access token can be used to request publicly shared Page posts as long as your app has been approved for the Page Public Content Access Feature. However, posts with message CTAs cannot be accessed using another Page's access token since pages cannot message other pages.

Get the URL for a Page Post

To get the URL for a Page post, or permalink, simply append the post ID to https://www.facebook.com/.

https://www.facebook.com/{post-id}

This URL will redirect the person to the post URL.

Create an Unpublished Post

To create an unpublished Page post, send a POST request to the /{page-id}/feed endpoint with the published parameter set to false.

Before You Start

You will need the following:

Sample Request

curl -i -X POST "https://graph.facebook.com/{page-id}/feed
  ?published=false
  &message=An unpublished post
  &access_token={page-access-token}"

On success, your app receives the following response:

{
  "id": "{page-post-id}"  
}

Your app should save the id to be used later to publish the content.

Publish an Unpublished Post

To publish an unpublished Page post, send a POST request to /{page-post-id} endpoint with the published parameter set to true.

Sample Request

curl -i -X POST "https://graph.facebook.com/{page-post-id}
  ?is_published=true
  &access_token={page-access-token}"

On success, your app receives the following response:

{
  "success" : true
}

Schedule a Page Post

To schedule a Page post to be published at a later time, send a POST request to the /{page-id}/feed endpoint with the published parameter set to false and the scheduled_publish_time parameter set to the timestamp in any of the following formats:

  • An integer UNIX timestamp [in seconds] (e.g. 1530432000)
  • An ISO 8061 timestamp string (e.g. 2018-09-01T10:15:30+01:00)
  • Any string otherwise parsable by PHP's strtotime() (e.g. +2 weeks, tomorrow)*

Note, if you are relying on strtotime()'s relative date strings you can read-after-write the scheduled_publish_time of the created post to make sure it is what is expected.

Before You Start

You will need the following:

Limitations

  • The published date must be between 10 minutes and 75 days from the time of the API request.

Sample Request

curl -i -X POST "https://graph.facebook.com/{page-id}/feed
  ?published=false
  &message=A scheduled post
  &scheduled_publish_time={unix-time-stamp-of-a-future-date}
  &access_token={page-access-token}"

On success, your app receives the following response:

{
  "id": "{page-post-id}"   
}  

Update a Post

To update a Page post, send a POST request to the /{page-post-id} endpoint with the message parameter set to the new text.

Before You Start

You will need the following:

Sample Request

curl -i -X POST "https://graph.facebook.com/{page-post-id}
  ?message=I am updating my Page post.
  &access_token={page-access-token}"

On success, your app receives the following response:

{
  "success": true
}

Limitations

An app can only update a post if it was made using that app.

See Also

Delete a Post

To delete a Page post, send a DELETE request to the /{page-post-id} endpoint.

Before You Start

You will need the following:

Sample Request

curl -i -X DELETE "https://graph.facebook.com/{page-post-id}
  ?access_token={page-access-token}"

On success, your app receives the following response:

{
  "success": true
}

Get Comments on a Page Post

To get the comments for a Page post, send a GET request to the /{page-post-id}/comments endpoint.

Before You Start

You will need the following:

Sample Request

curl -i -X GET "https://graph.facebook.com/{page-post-id}/comments
  ?access_token={page-access-token}"

On success, your app receives the following response:

{
  "data": [
    {
      "created_time": "2020-02-19T23:05:53+0000",
      "from": {
        "name": "Kelly Visitor",
        "id": "{user-id}"
      },
      "message": "I published this comment on a Page post",
      "id": "{comment-id}"
    }
  ],
  "paging": {
    "cursors": {
      "before": "MQZDZD",
      "after": "MQZDZD"
    }
  }
}

Comment on a Post

To comment on a Page post, send a POST request to the /{page-post-id}/comments endpoint with the message field.

Before You Start

You will need the following:

Sample Request

curl -i -X POST "https://graph.facebook.com/{page-post-id}/comments
  ?message=Nice post!
  &access_token={page-access-token}"

On success, your app receives the following response:

{
  "id":"{comment-id}"  
}

Limitations

If a Page is unpublished no one will be able to comment on a Page post or comments. A Page can comment on a its own comments. If you try to comment as a User you will see a 1705 error.

{
  "error":{
    "message":"(#1705) There was an error posting to this wall",
    "type":"OAuthException", 
    "code":1705,
    "fbtrace_id":"HWxq+vf3HsQ"
  }
}