グラフAPIバージョン

グループのアルバム

グループ用に作成された写真アルバム。

読み取り

グループのアルバムの配列が返されます。

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

要件

要件説明

アプリレビュー

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

アプリのインストール

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

トークン

ユーザーアクセストークン。

フィールド

フィールド拡張機能を通して以下のアルバムフィールドをリクエストすると、groups_access_member_infoアクセス許可をアプリに付与したユーザーの結果のみが返されます:

  • from
  • likes
  • reaction

公開

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

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

要件

要件のタイプ説明

アプリレビュー

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

ログインアクセス許可

publish_to_groups

機能

グループAPI

アプリのインストール

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

トークン

アプリがインストールされているグループのメンバーであるユーザーのユーザーアクセストークン。

アクセス許可

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

publish_to_groups

フィールド

パラメーター 説明

name

アルバムに付けられた名前。このフィールドは必須です。

string

message

アルバムの説明。ステータスメッセージとしてフィードに表示されます。

string

応答

名前 説明

ID

新たに作成されたアルバムのID。

string

削除

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

更新

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