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

ฟีดของกลุ่ม

โพสต์ที่เป็นของกลุ่ม ซึ่งรวมถึงสถานะการอัพเดตและลิงก์

การอ่าน

ส่งคืนอาร์เรย์ของโพสต์ในกลุ่ม

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

การอัพเดต

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

การลบ

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