グラフAPIバージョン

グループフィード

グループが所有する投稿、ステータスアップデートとリンクを含みます。

読み取り

グループの投稿の配列を返します。

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

要件

要件のタイプ説明

アプリレビュー

アプリはグループAPI機能について承認を受ける必要があります。

アプリのインストール

アプリがグループにインストールされている必要があります。

トークン

ユーザーアクセストークンまたはページアクセストークン。

注記

  • sinceパラメーターとuntilパラメーターはupdated_timeフィールドに適用されます。

公開

POST /v19.0/{group-id}/feed HTTP/1.1
Host: graph.facebook.com

message=This+is+a+test+message
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{group-id}/feed',
    array (
      'message' => 'This is a test message',
    ),
    '{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(
    "/{group-id}/feed",
    "POST",
    {
        "message": "This is a test message"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("message", "This is a test message");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}/feed",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"message": @"This is a test message",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{group-id}/feed"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

要件

要件のタイプ説明

アプリレビュー

以下のログインアクセス許可と機能を使用するには、アプリが承認されている必要があります。(クリックして展開)

ログインアクセス許可

publish_to_groups

機能

グループAPI

アプリのインストール

アプリがグループにインストールされている必要があります。

トークン

グループのメンバーのユーザーアクセストークン。

アクセス許可

ユーザーが次のアクセス許可をアプリに付与する必要があります。

publish_to_groups

フィールド

名前説明

message

string

投稿の本文。ステータスメッセージとも呼ばれます。linkまたはmessageのいずれかを指定する必要があります。

link

string

投稿に添付するリンクのURL。linkまたはmessageのいずれかを指定する必要があります。linkに関連付けられている追加フィールドを以下に示します。

応答

成功すると、次の情報を含む応答を受け取ります。また、このエンドポイントはリードアフターライトをサポートしており、読み取り操作で返されたフィールドをすぐに返すことができます。

名前 説明

id

新たに作成された投稿ID

string

更新

この操作はサポートされていません。

削除

この操作はサポートされていません。