เวอร์ชันของ API กราฟ

อัลบั้มในกลุ่ม

อัลบั้มรูปภาพที่สร้างสำหรับกลุ่ม

การอ่าน

ส่งคืนอาร์เรย์ของอัลบั้มในกลุ่ม

Graph API Explorer
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

การลบ

ระบบไม่รองรับการดำเนินการนี้

การอัพเดต

ระบบไม่รองรับการดำเนินการนี้