A Post that was published on a Facebook Page.
The source
field will not be returned for Page-owned videos unless the User making the request is an admin of the owning Page.
Name | Description |
---|---|
Page Public Content Access | This feature permission may be required. |
GET /v23.0/{page-id}_{post-id}/ 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}_{post-id}/',
'{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}_{post-id}/",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}_{post-id}/",
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}_{post-id}/"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
curl -X GET -G \
-d 'access_token=' \
https://graph.facebook.com/v23.0/{page-id}_{post-id}/
Field | Description |
---|---|
id token with structure: Post ID | The post ID |
actions list | Action links |
admin_creator BusinessUser|User|Application | The admin creator of a Page Post. Only available if there exists more than one admin for the page. |
allowed_advertising_objectives list | Objectives under which this post can be advertised |
application | Information about the app this post was published by. |
backdated_time datetime | The backdated time for backdate post. For regular post, this field will be set to null. |
call_to_action struct with keys: type, value | The call to action type used in any Page posts for mobile app engagement ads. |
can_reply_privately bool | Whether the page viewer can send a private reply to this post |
child_attachments list | Sub-shares of a multi-link share post |
comments_mirroring_domain string | If comments are being mirrored to an external site, this function returns the domain of that external site. |
coordinates struct with keys: checkin_id, author_uid, page_id, target_id, target_href, coords, tagged_uids, timestamp, message, target_type | An array of information about the attachment to the post |
created_time datetime | The time the post was published, expressed as UNIX timestamp |
If this Post has a place, the event associated with the place | |
expanded_height unsigned int32 | An array of information about the attachment to the post |
expanded_width unsigned int32 | An array of information about the attachment to the post |
feed_targeting struct with keys: country, cities, regions, genders, age_min, age_max, education_statuses, college_years, relationship_statuses, interests, interested_in, user_adclusters, locales, countries, geo_locations, work_positions, work_employers, education_majors, education_schools, family_statuses, life_events, industries, politics, ethnic_affinity, generation, fan_of, relevant_until_ts | Object that controls Feed targeting for this post. Anyone in these groups will be more likely to see this post, others will be 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). |
from User|Page | The ID of the user, page, group, or event that published the post |
full_picture string | Full size picture from attachment |
height unsigned int32 | An array of information about the attachment to the post |
icon string | A link to an icon representing the type of this post. |
is_app_share bool | Whether or not the post references an app |
is_eligible_for_promotion bool | Whether the post is eligible for promotion. |
is_expired bool | Whether the post has expiration time that has passed |
is_hidden bool | Whether a post has been set to hidden |
is_inline_created bool | Returns True if the post was created inline when creating ads. |
is_popular bool | Whether the post is currently popular. Based on whether the total actions as a percentage of reach exceeds a certain threshold |
is_published bool | Indicates whether a scheduled post was published (applies to scheduled Page Post only, for users post and instanlty published posts this value is always true) |
is_spherical bool | Whether the post is a spherical video post |
message string | The message written in the post |
message_tags list | Profiles tagged in message. This is an object with a unique key for each tag in the message |
multi_share_end_card bool | Whether display the end card for a multi-link share post |
multi_share_optimized bool | Whether automatically select the order of the links in multi-link share post when used in an ad |
parent_id token with structure: Post ID | 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 parent_id will be the original post where the mention happened |
permalink_url uri | The permanent static URL to the post on www.facebook.com. Example: https://www.facebook.com/FacebookforDevelopers/posts/10153449196353553 |
place | ID of the place associated with the post |
privacy | The privacy settings for a post |
token with structure: Post ID | ID of post to use for promotion for stories that cannot be promoted directly |
properties list | A list of properties for any attached video, for example, the length of the video. |
scheduled_publish_time float | UNIX timestamp of the scheduled publish time for the post |
shares struct with keys: count | Number of times the post has been shared |
status_type string | Description of the type of a status update. |
story string | Text of stories not intentionally generated by users, such as those generated when two users become friends. You must have the "Include recent activity stories" migration enabled in your app to retrieve this field |
story_tags list | The list of tags in the post description |
subscribed bool | Whether user is subscribed to the post |
The profile this was posted on if different from the author | |
targeting struct with keys: country, cities, regions, zips, genders, college_networks, work_networks, age_min, age_max, education_statuses, college_years, college_majors, political_views, relationship_statuses, interests, keywords, interested_in, user_clusters, user_clusters2, user_clusters3, user_adclusters, excluded_user_adclusters, custom_audiences, excluded_custom_audiences, locales, radius, connections, excluded_connections, friends_of_connections, countries, excluded_user_clusters, adgroup_id, user_event, qrt_versions, page_types, user_os, user_device, action_spec, action_spec_friend, action_spec_excluded, geo_locations, excluded_geo_locations, targeted_entities, conjunctive_user_adclusters, wireless_carrier, site_category, work_positions, work_employers, education_majors, education_schools, family_statuses, life_events, behaviors, travel_status, industries, politics, markets, income, net_worth, home_type, home_ownership, home_value, ethnic_affinity, generation, household_composition, moms, office_type, interest_clusters_expansion, dynamic_audience_ids, product_audience_specs, excluded_product_audience_specs, exclusions, flexible_spec, engagement_specs, excluded_engagement_specs | Object that limited 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. |
timeline_visibility string | Timeline visibility information of the post |
updated_time datetime | The time the post was last updated, which occurs when a user comments on the post. |
via User|Page | ID of the user or Page the post was shared from |
width unsigned int32 | An array of information about the attachment to the post |
Edge | Description |
---|---|
Edge | Any attachments that are associated with the story |
Edge | Comments made on this |
Edge | All dynamic ad creatives |
Edge | Insights for this post (only for Pages). |
Edge | People who like this |
Edge | People who reacted on this |
Edge | Shared posts |
Edge | An array sponsor pages tagged in the post |
Edge | Profiles mentioned or targeted in this post. |
Error | Description |
---|---|
100 | Invalid parameter |
200 | Permissions error |
190 | Invalid OAuth 2.0 Access Token |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
80001 | There have been too many calls to this Page account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting. |
2500 | Error parsing graph query |
283 | That action requires the extended permission pages_read_engagement and/or pages_read_user_content and/or pages_manage_ads and/or pages_manage_metadata |
3001 | Invalid query |
/{page_post_id}
.POST /v23.0/{page-id}_{post-id}/ HTTP/1.1
Host: graph.facebook.com
message=This+is+a+test+value
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->post(
'/{page-id}_{post-id}/',
array (
'message' => 'This is a test value',
),
'{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}_{post-id}/",
"POST",
{
"message": "This is a test value"
},
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
Bundle params = new Bundle();
params.putString("message", "This is a test value");
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}_{post-id}/",
params,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
NSDictionary *params = @{
@"message": @"This is a test value",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}_{post-id}/"
parameters:params
HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
curl -X POST \
-F 'message="This is a test value"' \
-F 'access_token=' \
https://graph.facebook.com/v23.0/{page-id}_{post-id}/
Parameter | Description |
---|---|
attached_media list | attached_media |
backdated_time datetime | SELF_EXPLANATORY |
backdated_time_granularity enum{year, month, day, hour, min, none} | Default value: none SELF_EXPLANATORY |
composer_session_id string | composer_session_id |
direct_share_status int64 | The status to allow sponsor directly boost the post. |
explicitly_added_mentionee_ids list | List of IDs that were explicitly mentioned by the user (i.e. typed) rather than auto-populated by the product. |
feed_story_visibility enum{hidden, visible} | SELF_EXPLANATORY |
is_approved boolean | SELF_EXPLANATORY |
is_explicit_location boolean | is_explicit_location |
is_hidden boolean | SELF_EXPLANATORY |
is_pinned boolean | SELF_EXPLANATORY |
message UTF-8 string | SELF_EXPLANATORY Supports Emoji |
og_action_type_id numeric string or integer | SELF_EXPLANATORY |
og_hide_object_attachment boolean | SELF_EXPLANATORY |
og_icon_id numeric string or integer | SELF_EXPLANATORY |
og_object_id OG object ID or URL string | SELF_EXPLANATORY |
og_phrase string | SELF_EXPLANATORY |
og_set_profile_badge boolean | og_set_profile_badge |
og_suggestion_mechanism string | SELF_EXPLANATORY |
place place tag | SELF_EXPLANATORY |
privacy Privacy Parameter | SELF_EXPLANATORY |
product_item Object | SELF_EXPLANATORY Supports Emoji |
scheduled_publish_time int64 | SELF_EXPLANATORY |
should_sync_product_edit boolean | should_sync_product_edit |
source_type string | source_type |
sponsor_id numeric string or integer | Facebook Page id that is tagged as sponsor in the Feed post |
sponsor_relationship int64 | Sponsor Relationship, such as Presented By or Paid PartnershipWith |
tags list | SELF_EXPLANATORY |
text_format_preset_id numeric string or integer | text_format_preset_id |
timeline_visibility enum{hidden, normal, forced_allow} | SELF_EXPLANATORY |
tracking JSON-encoded string | SELF_EXPLANATORY |
success
: bool, Error | Description |
---|---|
210 | User not visible |
100 | Invalid parameter |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
200 | Permissions error |
102 | Session key invalid or no longer valid |
190 | Invalid OAuth 2.0 Access Token |
104 | Incorrect signature |
Only select developers can perform this operation using the API. You can use the Business Manager to delete posts.
/{page_post_id}
.DELETE /v23.0/{page-id}_{post-id}/ HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->delete(
'/{page-id}_{post-id}/',
array (),
'{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}_{post-id}/",
"DELETE",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);
/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{page-id}_{post-id}/",
null,
HttpMethod.DELETE,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{page-id}_{post-id}/"
parameters:params
HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];
curl -X DELETE -G \
-F 'access_token=' \
https://graph.facebook.com/v23.0/{page-id}_{post-id}/
success
: bool, Error | Description |
---|---|
200 | Permissions error |
100 | Invalid parameter |
190 | Invalid OAuth 2.0 Access Token |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
80001 | There have been too many calls to this Page account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting. |