グラフAPIバージョン

/{object-id}/sharedposts

このリファレンスでは、複数のグラフAPIノードに共通する/sharedpostsエッジについて説明します。どのノードも構造と操作は同じです。sharedpostsエッジは、以下のオブジェクトにあります。

  • PagePost
  • Post
  • User

読み取り

アクセス許可

  • user_postsアクセス許可を付与されたユーザーアクセストークン。プライバシー設定を考慮した上で投稿を閲覧できる人の場合に使用します。(a)アプリが作成した投稿の場合、または(b)投稿作成者からアプリにuser_postsアクセス許可が付与されている場合、投稿が返されます。

機能アクセス許可

名前説明

ページの公開コンテンツへのアクセス

これは、必須の機能アクセス許可です。

制限

  • /{album-id}/sharedpostsは利用できません。
  • GET /{photo-id}/sharedpostsエンドポイントは、v8.0以上で廃止されています。

グラフAPIエクスプローラ
GET /v19.0/{object-id}/sharedposts 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(
    '/{object-id}/sharedposts',
    '{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(
    "/{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();
/* 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
}];

フィールド

各シェアを表すpostオブジェクトのリスト。

公開

グラフAPIを使ってオブジェクトのシェアを公開することはできません。

削除

グラフAPIを使ってオブジェクトのシェアを削除することはできません。