/{object-id}/sharedpostsこのリファレンスでは、複数のグラフAPIノードに共通する/sharedpostsエッジについて説明します。どのノードも構造と操作は同じです。sharedpostsエッジは、以下のオブジェクトにあります。
user_postsアクセス許可を付与されたユーザーアクセストークン。プライバシー設定を考慮した上で投稿を閲覧できる人の場合に使用します。(a)アプリが作成した投稿の場合、または(b)投稿作成者からアプリにuser_postsアクセス許可が付与されている場合、投稿が返されます。| 名前 | 説明 |
|---|---|
ページの公開コンテンツへのアクセス | これは、必須の機能アクセス許可です。 |
/{album-id}/sharedpostsは利用できません。GET /{photo-id}/sharedpostsエンドポイントは、v8.0以上で廃止されています。GET /v24.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を使ってオブジェクトのシェアを削除することはできません。