Dieses Dokument wurde aktualisiert.
Die Übersetzung ins Deutsche ist noch nicht fertig.
Englisch aktualisiert: 4. Juni
Deutsch aktualisiert: 24.05.2018

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 Post

Before You Start

You will need the following:

Send a POST request to the /{page-id}/feed endpoint:

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

Send a POST request to the /{page-id}/feed endpoint and include the link parameter:

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

Send a POST request to /{page-id}/photos endpoint:

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

Additional Requirements

Send a POST request to /{page-id}/videos endpoint:

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

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:

Send a GET request to the /{page-id}/feed endpoint:

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 of a Page Post

To get the URL of 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

Before You Start

You will need the following:

Send a POST request to the /{page-id}/feed endpoint with the published parameter set to false:

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

Send a POST request to /{page-post-id} endpoint with the published parameter set to true:

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

On success, your app receives the following response:

{
  "success" : true
}

Schedule a Page Post

Before You Start

You will need the following:

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.

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}"

On success, your app receives the following response:

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

Update a Post

Before You Start

You will need the following:

Send a POST request to the /{page-post-id} endpoint with the message parameter set to the new text:

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

Before You Start

You will need the following:

Send a DELETE request to the /{page-post-id} endpoint:

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

Before You Start

You will need the following:

Send a GET request to the /{page-post-id}/comments endpoint:

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

Before You Start

You will need the following:

Send a POST request to the /{page-post-id}/comments endpoint with the message field:

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"
  }
}