CARVIEW |

Page Feed
Use this endpoint to get and publish to a Page. The Page Feed encompasses any interactions with a Facebook Page including: posts and links published by this Page, visitors to this Page, and public posts in which the Page has been tagged.
See Also
- The
/{page-post-id}
endpoint allows you to update a specific Page post. - The
/{page-id}/tagged
endpoint to only retrieve public posts in which the Page has been tagged.
Reading
The posts of a Facebook Page.
New Page Experience
This API is supported for New Page Experience.
Requirements
The person requesting the access token must be able to perform one of the following tasks on the Page:
- CREATE_CONTENT – Publish content as the Page on the Page
- MANAGE – Assign and manage Page tasks
- MODERATE
- Respond to comments on Page posts as the Page
- Delete comments on Page posts
- If an Instagram account is connected to the Page, publish content to Instagram from Facebook, respond to and delete comments, send Direct messages, sync business contact info, and create ads.
And have granted the app the following permissions are required:
If you do not own or manage the Page, you will need:
Sample Request
GET /v23.0/{page-id}/feed HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/{page-id}/feed',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/{page-id}/feed",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}/feed",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}/feed"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Sample JSON Response
{ "data": [ { "created_time": "2019-05-17T16:24:04+0000", "message": "Become a Facebook developer!", "id": "{page-id}_2191966997525824" }, { "created_time": "2019-02-26T21:35:42+0000", "message": "Hello world!", "id": "{page-id}_2072371269485398" }, ... { "created_time": "2018-01-26T20:57:22+0000", "message": "Friday Funday!", "id": "{page-id}_1569752556413941" } ], "paging": { "cursors": { "before": "Q2c4U1pXNT...", "after": "Q2c4U1pXNT..." }, "next": "https://graph.facebook.com/vX.X/{page-id}/feed?access_token={your-page-access-token}&pretty=0&limit=25&after=Q2c4U1pXNT..." } }
Limitations
- Expired Posts – If a Post has expired, you will no longer be able to view the content using the Graph API.
- Maximum Posts
- The API will return approximately 600 ranked, published posts per year.
- You can only read a maximum of 100 feed posts with the
limit
field. If you try to read more than that you will get an error message to not exceed 100.
- Message CTA - Posts with message CTAs cannot be accessed using another Page's access token since Pages cannot message other Pages.
- Publicly Identifiable Information - User information will not be in included in responses unless you make the request with a Page access token.
- Published Posts – Published and unpublished posts will be returned when querying the `/{page-id}/feed` endpoint. Use the 'is_published` field to return only published posts.
- Shared Posts - A Page post which shares a post from another Page or person may not be visible if the original post isn't visible with the access token used.
- Tagged Posts - When you use
/{page-id}/tagged
to show the posts that tagged this Page, the results include posts from other Pages only if those Pages are authentic. - User Agents - The available user agents allowed for these Graph API calls are subject to change without notice. If you are experiencing issues, you may want to change to a newer version of your particular user agent.
- Video Posts - To get a list of video posts, the person making the request must be an admin of the Page.
- Reels To get a list of Reels published to your Page, use the Page VideoReels edge.
Limitation: All posts (published and unpublished) will be pulled in the feed endpoint. The only difference is unpublished posts will not be listed in the physical feed. However, there is an is_published field that can be added to the /feed endpoint to let developers know whether the post listed in the /feed endpoint is published or not
Fields
Name | Type | Description | |
---|---|---|---|
id | string | The ID of the post. | |
actions | object | Action links on the post, Comment, Like, Share. | |
admin_creator | object | The admin creator of a Page post. If the Page has only one admin, no data is returned. Requires a Page Access Token and the | |
id | int | ID of the person, app or business. | |
name | string | Name of the person, app or business. | |
allowed_advertising_objects | string | The only objectives under which this post can be advertised. | |
application | object | Information about the app that published this post. | |
attachments | object | Any attachments that are associated with the story. See the story attachment node reference for | |
backdated_time | float | The backdated time for backdate post. For a regular post, this field is set to null. | |
call_to_action | object | The call to action type used in any Page posts for mobile app engagement ads. | |
context | object | The call to action type used in any Page posts for mobile app engagement ads. | |
can_reply_privately | boolean | Whether the Page viewer can send a private reply to this Post. Requires the | |
child_attachments | object | Sub-shares of a multi-link share post. | |
created_time | float | The time the post was initially published. For a post about a life event, this is the date and time of the life event. | |
feed_targeting | object | Object that controls Feed Targeting for this post. Anyone in these groups are more likely to see this post, others are less likely, but may still see it anyway. Any of the targeting fields shown here can be used, none are required (applies to Pages only). | |
age_max | int | Maximum age | |
age_min | int | Must be 13 or higher. Default is 0 | |
cities | int | Values of targeting cities. Use | |
college_years | int | Array of integers for graduation year from college. | |
countries | string | Values of targeting countries. You can specify up to 25 countries. Use ISO 3166 format codes. | |
education_statuses | int | Array of integers for targeting based on education level. Use | |
genders | int | Target specific genders. | |
interested_in Deprecated. | int | ||
interests | int | One or more IDs of pages to target fans of pages. Use type of page to get possible IDs as Targeting Options and use the returned id to specify. | |
locales | int | Targeted locales. Use | |
regions | array | Values of targeting regions. Use | |
relationship_statuses | int | Array of integers for targeting based on relationship status. Use | |
from |
| The | |
full_picture | string | URL to a full-sized version of the Photo published in the Post or scraped from a link in the Post. If the photo's largest dimension exceeds 720 pixels, it is resized, with the largest dimension set to 720. | |
icon | string | A link to an icon representing the type of this post. | |
instagram_eligibility | enum{} | Whether the post can be promoted on Instagram. It returns the enum
| |
is_eligible_for_promotion | boolean | Indicates whether a post is eligible for promotion. | |
is_expired | boolean | Whether the post has an expiration time that has passed. | |
is_hidden | boolean | If this post is marked as hidden (Applies to Pages only). Hiding a post hides it in a Page's timeline however it is still visible in other places on Facebook, for example, a link. | |
is_instagram_eligible | string | Whether this post can be promoted in Instagram. | |
is_popular | boolean | Whether the post is popular. Based on whether the total actions as a percentage of reach exceeds a certain threshold. | |
is_published | boolean | Indicates whether a scheduled post was published (applies to scheduled Page Post only, for users post and instantly published posts this value is always | |
is_spherical | boolean | Whether the post is a spherical video post. | |
message | string | The status message in the post. | |
message_tags | array | An array of profiles tagged in the | |
length | int | The length of the tag text, in unicode code points. | |
id | string | ID of the profile that was tagged. | |
name | string | The text used to tag the profile. | |
offset | int | The location in unicode code points of the first character of the tag text in the | |
type | enum{} | The tagged profile's type, | |
parent_id | string | The ID of a parent post for this post, if it exists. For example, if this story is a 'Your Page was mentioned in a post' story, the | |
permalink_url | string | The permanent static URL to the post on www.facebook.com. Example: https://www.facebook.com/FacebookForDevelopers/posts/10153449196353553. | |
place | string | ID of the place associated with this post. | |
privacy | object | The privacy settings of the post. | |
allow | string | If | |
deny | string | If | |
description | string | Text that describes the privacy settings, as they would appear on Facebook. | |
friends | enum{} | If
| |
value | enum{} | The actual privacy setting. Values include:
| |
promotable_id | string | ID of post to use for promotion for stories that cannot be promoted directly. | |
properties | object | A list of properties for any attached video, for example, the length of the video. | |
name | string | The property name. | |
text | string | The value of the property. | |
href | string | Any link associated with the property. | |
sheduled_publish_time | float | The UNIX timestamp of the scheduled publish time for the post. Date will be between 10 minutes and 75 days from the time of the | |
shares | object | The share count of this post. The share count may include deleted posts and posts you cannot see for privacy reasons. | |
status_type | enum{} | The type of a status update. Values include:
| |
story | string | Text of stories not intentionally generated by Users, such as those generated when a photo has been added. The "Include recent activity stories" migration must be enabled in your app to retrieve this field. | |
story_tags | array | The list of tags in the post description. | |
subscribed | boolean | Whether a User is subscribed to the post. | |
targeting | object | Object that limits the audience for this content. Only audiences in the specified demographics can view this content. The demographics are additive. Each additional value adds its audience to the cumulative targeted audience. These values do not override any Page-level demographic restrictions that may be in place. | |
countries | string | Values of targeting countries as ISO 3166 format codes. | |
locales | int | Targeted locales. Targeting Options of the type | |
regions | list<int> | Values for targeted regions. Targeting Options of the type | |
cities | list<int> | Values for excluded cities. Targeting Options of the type | |
to |
| Profiles mentioned or targeted in this post. If you read this field with a User access token, it returns only the current User. | |
updated_time | float | The time the post was last updated, which occurs when the post was created, edited, or a User comments on a post, expressed as a UNIX timestamp. | |
video_buying_eligibility | array | Whether the post can be promoted with different video buying options. It returns an empty list when video is eligible. Otherwise it returns a list of reasons why the post cannot be promoted. |
Promotable IDs
When finding posts that can be boosted, the promotable_id
must be used to create ads. In most cases, this id will be identical to the post_id
. However, this is not always the case. Note: once a post is boosted, you must have access to the connected ad account in order to edit the post.
Example Request
curl -i -X GET \
"https://graph.facebook.com/{your-page-id}/feed
?fields=is_eligible_for_promotion,promotable_id
&access_token={your-page-access-token}"
GraphRequest request = GraphRequest.newGraphPathRequest(
accessToken,
"/{your-page-id}/feed",
new GraphRequest.Callback() {
@Override
public void onCompleted(GraphResponse response) {
// Insert your code here
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "is_eligible_for_promotion,promotable_id");
request.setParameters(parameters);
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{your-page-id}/feed"
parameters:@{ @"fields": @"is_eligible_for_promotion,promotable_id",}
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
// Insert your code here
}];
FB.api(
'/{your-page-id}/feed',
'GET',
{"fields":"is_eligible_for_promotion,promotable_id"},
function(response) {
// Insert your code here
}
);
try {
// Returns a `FacebookFacebookResponse` object
$response = $fb->get(
'/{your-page-id}/feed?fields=is_eligible_for_promotion,promotable_id',
'{access-token}'
);
} catch(FacebookExceptionsFacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
Example Response
{ "data": [ { "is_eligible_for_promotion": true, "promotable_id": "1353269864728879_1943344825721377", "id": "1353269864728879_1943344825721377" }, { "is_eligible_for_promotion": true, "promotable_id": "1353269864728879_1943313139057879", "id": "1353269864728879_1943378089051384" }, { "is_eligible_for_promotion": false, "promotable_id": "1353269864728879_1942095249179668", "id": "1353269864728879_1942095249179668" }, ...
Please visit our help center to learn why a post may not be boosted.
Please visit our Post Reference doc for all available post fields.
Publishing
You can publish to Pages by using this edge. Either link
or message
must be supplied.
New Page Experience
This API is supported for New Page Experience.
Requirements
If you can perform the CREATE_CONTENT
task, you will need:
- A Page access token
Posts will appear in the voice of the Page.
Permissions
A Page access token requested by someone who can perform the
on the Page being queried
Note: If the viewer or app cannot see the url of link
, the post will fail.
POST /v23.0/{page-id}/feed HTTP/1.1
Host: graph.facebook.com
message=This+is+a+test+message
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/{page-id}/feed',
array (
'message' => 'This is a test message',
),
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/{page-id}/feed",
"POST",
{
"message": "This is a test message"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Bundle params = new Bundle();
params.putString("message", "This is a test message");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}/feed",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
NSDictionary *params = @{
@"message": @"This is a test message",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}/feed"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
Response
{"id":"post-id"}
This endpoint supports read-after-write and can immediately return any fields returned by read operations.
Graph Explorer Tool Example
Test in the Graph Explorer Tool using POST {page-id}/feed
:

Fields
Name | Type | Description |
---|---|---|
actions | array | The action links attached to the post. |
link | string | The URL of the action link itself. |
name | string | The name or label of the action link. |
backdated_time | float | Specifies a time in the past to backdate this post to. |
backdated_time_granularity | enum{year, month, day, hour, minute} | Controls the display of how a backdated post appears. For example, if you pick |
child_attachments | object | Use to specify multiple links in the post. Minimum 2 and maximum of 5 objects. If you set multi_share_optimized to true, you can upload a maximum of 10 objects but Facebook will display the top 5. |
description | string | Used to show either a price, discount or website domain. If not specified, the content of the linked page will be extracted and used. This field will typically be truncated after 30 characters. |
image_hash | string | Hash of a preview image associated with the link from your ad image library (1:1 aspect ratio and a minimum of 458 x 458 px for best display). Either |
link | string | The URL of a link to attach to the post. This field is required. |
name | string | The title of the link preview. If not specified, the title of the linked page will be used. This field will typically be truncated after 35 characters. It is recommended to set a unique |
picture | string | A URL that determines the preview image associated with the link (1:1 aspect ratio and a minimum of 458 x 458 px for best display). Either |
feed_targeting | object | Object that controls Feed Targeting for this content. Anyone in these groups will be more likely to see this content, those not will be less likely, but may still see it anyway. Any of the targeting fields shown here can be used, none are required. |
age_max | int | Maximum age. Must be 65 or lower. |
age_min | int | Must be 13 or higher. Default is 0. |
college_years | int[] | Array of integers for graduation year from college. |
education_statuses | int[] | Array of integers for targeting based on education level. Use |
genders | list<unsigned int32> | Target specific genders. |
geo_locations | object | This object allows you to specify a number of different geographic locations. Please see our targeting guide for information on this object. |
interests | int[] | One or more IDs to target fans. Use |
locales | int | Targeted locales. Use |
relationship_statuses | list<unsigned int32> | Array of integers for targeting based on relationship status. Use |
link | string | The URL of a link to attach to the post. Either |
description | string | Overwrites the description in the link preview |
name | string | Overwrites the title of the link preview. |
picture | string | Determines the preview image associated with the link. |
thumbnail | file | Preview image associated with the link uploaded by you. |
message | string | The main body of the post. The message can contain mentions of Facebook Pages, |
multi_share_end_card | Boolean | If set to |
multi_share_optimized | Boolean | If set to |
object_attachment | string | Facebook ID for an existing picture in the person's photo albums to use as the thumbnail image. They must be the owner of the photo, and the photo cannot be part of a message attachment. |
place | string | Page ID of a location associated with this post. |
published | Boolean | Whether a story is shown about this newly published object. Default is |
scheduled_publish_time | timestamp | UNIX timestamp indicating when post should go live. Must be date between 10 minutes and 75 days from the time of the API request. |
tags | csv[string] | Comma-separated list of user IDs of people tagged in this post. You cannot specify this field without also specifying a |
targeting | object | Object that limits the audience for this content. Anyone not in these demographics will not be able to view this content. This will not override any Page-level demographic restrictions that may be in place. |
age_min | int | Value can be 13, 15, 18, 21, or 25. |
geo_locations | object | This object allows you to specify a number of different geographic locations. Please see our targeting guide for information on this object. |
Add a Feeling or Activity to a Page Post
Add a feeling or activity and an icon to a page post. og_action_type_id
and og_object_id
are required when posting a feeling or activity. og_icon_id
is optional however if not used an icon will be automatically supplied based on the og_object_id
.
Fields
Name | Description |
---|---|
An action, i.e., feeling, watching, etc. | |
An icon perhaps representing the action type, i.e., a smiley face, a movie icon, etc. | |
The target of the action, i.e., happy, movie, etc. This can be a predefined object or any |
Example Post
POST /v23.0/page-id/feed HTTP/1.1
Host: graph.facebook.com
message=This+is+a+test+activity&og_action_type_id=383634835006146&og_object_id=136050896551329&og_icon_id=609297155780549
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/page-id/feed',
array (
'message' => 'This is a test activity',
'og_action_type_id' => '383634835006146',
'og_object_id' => '136050896551329',
'og_icon_id' => '609297155780549',
),
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
"/page-id/feed",
"POST",
{
"message": "This is a test activity",
"og_action_type_id": "383634835006146",
"og_object_id": "136050896551329",
"og_icon_id": "609297155780549"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Bundle params = new Bundle();
params.putString("message", "This is a test activity");
params.putString("og_action_type_id", "383634835006146");
params.putString("og_object_id", "136050896551329");
params.putString("og_icon_id", "609297155780549");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/page-id/feed",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
NSDictionary *params = @{
@"message": @"This is a test activity",
@"og_action_type_id": @"383634835006146",
@"og_object_id": @"136050896551329",
@"og_icon_id": @"609297155780549",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/page-id/feed"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
The response will be the post_id
.
Unpublished Page Posts
We support the following types of Unpublished Page Posts:
Post Type | Description |
---|---|
A link Page post is most effective for sharing links to your website. Allows for optional replacement of image and extra text. | |
A photo Page post with a text description and an optional link as part of the description. | |
A Page post with a text description. | |
A video Page post with optional text description. |
Unpublished Page posts are treated the same as published Page posts except that they do not appear in /feed
.
To see a list of unpublished Page posts, query the is_published
field.
curl -i -X GET \
"https://graph.facebook.com/{page-id}/feed
?fields=is_published
&access_token={your-page-access-token}"
GraphRequest request = GraphRequest.newGraphPathRequest(
accessToken,
"/{page-id}/feed",
new GraphRequest.Callback() {
@Override
public void onCompleted(GraphResponse response) {
// Insert your code here
}
});
Bundle parameters = new Bundle();
parameters.putString("fields", "is_published");
request.setParameters(parameters);
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}/feed"
parameters:@{ @"fields": @"is_published",}
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
// Insert your code here
}];
FB.api(
'/{page-id}/feed',
'GET',
{"fields":"is_published"},
function(response) {
// Insert your code here
}
);
try {
// Returns a `FacebookFacebookResponse` object
$response = $fb->get(
'/{page-id}/feed?fields=is_published',
'{access-token}'
);
} catch(FacebookExceptionsFacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
To view a post on Facebook.com, you can navigate to https://www.facebook.com/{post-id} for most post types, or retrieve the actions
field of the post, which contains the URL at which a User can like or comment on the post.
Page Post call_to_action
You can enhance your link Page posts with call to action buttons.
The following call_to_action
field can be added to new link Page Posts.
Name | Type | Description |
---|---|---|
|
| Object that specifies a Call to Action button. This should be the action you want people to take when they see your post. Clicking on this button will take people to the link you specify. |
|
| Determines the call to action button text. One of allowed values:
|
Custom Link Page Post Image
Post a link to a Page with a customized link image. The story's attachment renders an image retrieved from the link. Currently it is possible to override that image by providing an optional picture
parameter with a URL to a new image. The thumbnail
parameter offers similar functionality with the key difference being that the parameter accepts a local image file which is uploaded to Facebook in the API call.
Permissions
- A Page access token is required.
- The link must be owned by the posting Page.
To verify link ownership, check the ownership_permissions{can_customize_link_posts}
field on the URL
node. You must call this endpoint before posting new links. Without this step, custom link Page posts will not work for un-scraped links. See our Link Ownership Guide for more information. For versions 2.10 and lower, picture
, name
, thumbnail
, and description
are deprecated. caption
is deprecated for all versions.
Parameters | Type | Description |
---|---|---|
| string | The description of the link (appears beneath the link caption). If not specified, this field is automatically populated by information scraped from the link, typically the title of the page. |
| string | The name of the link attachment. This field is automatically populated by information scraped from the link. |
| string | URL for the image. Image is sourced from the URL supplied in |
| file | Image file to be uploaded. Accepts |
Limitations
- The
thumbnail
parameter is only available for link posts on Facebook Pages. - The
thumbnail
parameter takes higher precedence over thepicture
parameter. If both are supplied thepicture
parameter is unused. - The
thumbnail
parameter accepts images with extension.jpg
.jpeg
.gif
or.png
. - The
thumbnail
parameter is not supported in batch requests.
Posting a Link to a Page
Post a link to a Page by sending a POST request to the /page/feed
edge. Set the publish
parameter to 1
to publish the post immediately or to 0
to create an unpublished post to be published later.
Sample Request
curl -i -X POST "https://graph.facebook.com/{your-page-id}/feed
?message=Become%20a%20Facebook%20developer!
&link=https%3A%2F%2Fdevelopers.facebook.com
&published=1
&access_token={your-page-access-token}"
GraphRequest request = GraphRequest.newPostRequest(
accessToken,
"/{your-page-id}/feed",
new JSONObject("{\"message\":\"Become a Facebook developer!\",\"link\":\"https://developers.facebook.com\",\"published\":\"1\"}"),
new GraphRequest.Callback() {
@Override
public void onCompleted(GraphResponse response) {
// Insert your code here
}
});
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{your-page-id}/feed"
parameters:@{ @"message": @"Become a Facebook developer!",@"link": @"https://developers.facebook.com",@"published": @"1",}
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
// Insert your code here
}];
FB.api(
'/{your-page-id}/feed',
'POST',
{"message":"Become a Facebook developer!","link":"https://developers.facebook.com","published":"1"},
function(response) {
// Insert your code here
}
);
try {
// Returns a `FacebookFacebookResponse` object
$response = $fb->post(
'/{your-page-id}/feed',
array (
'message' => 'Become a Facebook developer!',
'link' => 'https://developers.facebook.com',
'published' => '1'
),
'{access-token}'
);
} catch(FacebookExceptionsFacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
Sample Response
{"id":"{post-id}"}
Link Page Post with Call to Action
The call_to_action
field specifies the appropriate action and relevant link. This link should be the same as the link
parameter of the Page Post. In this call, title
, description
, caption
and picture
are optional, and when not provided, Facebook will read the equivalent properties from the link's Open Graph meta data. If the linked web page does not have Open Graph meta data, Facebook will try to guess these properties by scraping the web page's content.
Sample Request
curl -i -X POST "https://graph.facebook.com/{your-page-id}/feed
?message=Become a Facebook developer!
&link=https://developers.facebook.com
&call_to_action={"type":"SIGN_UP","value":{"link":"https://developers.facebook.com"}}
&published=1
&access_token={your-page-access-token}"
GraphRequest request = GraphRequest.newPostRequest(
accessToken,
"/{your-page-id}/feed",
new JSONObject("{\"message\":\"Become a Facebook developer!\",\"link\":\"https://developers.facebook.com\",\"published\":\"1\",\"call_to_action\":\"{\\\"type\\\":\\\"SIGN_UP\\\",\\\"value\\\":{\\\"link\\\":\\\"https://developers.facebook.com\\\"}}\"}"),
new GraphRequest.Callback() {
@Override
public void onCompleted(GraphResponse response) {
// Insert your code here
}
});
request.executeAsync();
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{your-page-id}/feed"
parameters:@{ @"message": @"Become a Facebook developer!",@"link": @"https://developers.facebook.com",@"published": @"1",@"call_to_action": @"{"type":"SIGN_UP","value":{"link":"https://developers.facebook.com"}}",}
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
// Insert your code here
}];
FB.api(
'/{your-page-id}/feed',
'POST',
{"message":"Become a Facebook developer!","link":"https://developers.facebook.com","published":"1","call_to_action":"{\"type\":\"SIGN_UP\",\"value\":{\"link\":\"https://developers.facebook.com\"}}"},
function(response) {
// Insert your code here
}
);
try {
// Returns a `FacebookFacebookResponse` object
$response = $fb->post(
'/{your-page-id}/feed',
array (
'message' => 'Become a Facebook developer!',
'link' => 'https://developers.facebook.com',
'published' => '1',
'call_to_action' => '{"type":"SIGN_UP","value":{"link":"https://developers.facebook.com"}}'
),
'{access-token}'
);
} catch(FacebookExceptionsFacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(FacebookExceptionsFacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
Sample Response
{"id":"{post-id}"}
Link Post with Custom Uploaded Image
Using a local file:
curl -F 'link=https://www.example.com' \ -F 'thumbnail=@/local/path/to/file/on/hard/drive/image.jpg' \ -F 'access_token=page-access-token'\ https://graph.facebook.com/v2.11/page-id/feed
Return Value
{"id":"post-id"}
Using an Image via URL:
curl -F 'link=https://www.example.com' \ -F 'picture=https://www.example.com/path/to/image.jpg' \ -F 'access_token=page-access-token'\ https://graph.facebook.com/v2.11/page-id/feed
Return Value
{"id":"post-id>"}
Photo Page Post
Please visit our Photo Node Reference for more information.
Video Page Post
Please visit our Page Video Reference for more information.
Page Post Insights
Please visit our Page Post Insights Reference for more information.
Updating
You can't update using this edge, however you can update posts using the /{post-id}
node.
Deleting
You can't delete using this edge, however you can delete posts using the /{post-id}
node.