グラフAPIバージョン

マイルストーン/{milestone-id}

これは、Facebookページのマイルストーンを表します。

関連ガイド

読み取り

グラフAPIエクスプローラ
GET /v19.0/{milestone-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(
    '/{milestone-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(
    "/{milestone-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{milestone-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:@"/{milestone-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

アクセス許可

ページの公開共有マイルストーンを表示するには、次のものが必要です。

自分の管理するページのマイルストーンを表示するには、次のものが必要です。

フィールド

名前 説明

id

マイルストーンイベントのID

string

title

マイルストーンのタイトル

string

from

マイルストーンを投稿したページ。

Page

description

マイルストーンの説明

string

created_time

マイルストーンの作成時刻

datetime

updated_time

マイルストーンの更新時刻

datetime

start_time

マイルストーンの開始時刻

datetime

end_time

マイルストーンの終了時刻。ページマイルストーンの開始時刻と終了時刻は同じ

datetime

作成

このエンドポイントではこの操作を実行できません。

ページの新しいマイルストーンを作成するには、/{page-id}/milestonesエンドポイントを使います。

削除

アクセス許可

自分の管理するページのマイルストーンを削除するには、次のものが必要です。

DELETE /v19.0/{milestone-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(
    '/{milestone-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(
    "/{milestone-id}",
    "DELETE",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{milestone-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:@"/{milestone-id}"
                                      parameters:params
                                      HTTPMethod:@"DELETE"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

フィールド

削除のために必要なフィールドはありません。

応答

成功した場合は、次のようになります。

{
  "success": true
}

成功しなかった場合は、関連するエラーメッセージが返されます。

更新

アクセス許可

このエンドポイントではこの操作を実行できません。

エッジ

名前 説明

/likes

「いいね!」のリスト。

/comments

コメントのリスト。