Graph API Version
/{object-id}/sharedposts
The /sharedposts edge that is common to multiple Graph API nodes. The structure and operations are the same for each node.
This edge represents any posts where the original object was shared on Facebook.
Reading
GET /v2.9/{object-id}/sharedposts HTTP/1.1
Host: graph.facebook.com/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
$session,
'GET',
'/{object-id}/sharedposts'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result *//* make the API call */
FB.api(
"/{object-id}/sharedposts",
function (response) {
if (response && !response.error) {
/* handle the result */
}
}
);/* make the API call */
new GraphRequest(
AccessToken.getCurrentAccessToken(),
"/{object-id}/sharedposts",
null,
HttpMethod.GET,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
}
}
).executeAsync();// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
initWithGraphPath:@"/{object-id}/sharedposts"
parameters:params
HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
id result,
NSError *error) {
// Handle the result
}];Permissions
- A user access token with
user_postspermission, for someone who is able to view the post after privacy settings are taken into account.
Fields
A list of Post objects representing each of the shares.
Publishing
You cannot publish shares of an object using the Graph API.
Deleting
You cannot delete shares of an object using the Graph API.