Phiên bản API Đồ thị

Bảng feed nhóm

Các bài viết thuộc sở hữu của một Nhóm, bao gồm cả cập nhật trạng thái và liên kết.

Đọc

Trả về một mảng Bài viết trong Nhóm.

Trình khám phá API Đồ thị
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
}];

Yêu cầu

Loại yêu cầuMô tả

Xét duyệt ứng dụng

Ứng dụng của bạn phải được phê duyệt tính năng API Nhóm.

Cài đặt ứng dụng

Ứng dụng phải được cài đặt trong Nhóm.

Mã truy cập dành cho Người dùng hoặc mã truy cập Trang.

Lưu ý

  • Các thông số sinceuntil áp dụng cho trường updated_time.

Đăng

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
}];

Yêu cầu

Loại yêu cầuMô tả

Xét duyệt ứng dụng

Ứng dụng của bạn phải được phê duyệt các tính năng và quyền đăng nhập sau đây: (Nhấp để mở rộng)

Quyền đăng nhập

publish_to_groups

Tính năng

API Nhóm

Cài đặt ứng dụng

Ứng dụng phải được cài đặt trong Nhóm.

Mã truy cập dành cho Người dùng của một thành viên trong Nhóm.

Quyền

Người dùng phải cấp cho ứng dụng của bạn các quyền sau đây:

publish_to_groups

Trường

TênLoạiMô tả

message

string

Nội dung chính của bài viết, còn gọi là thông báo trạng thái. Bạn phải cung cấp link hoặc message.

link

string

URL của liên kết sẽ đính kèm vào bài viết. Bạn phải cung cấp link hoặc message. Dưới đây là các trường bổ sung được liên kết với link.

Phản hồi

Nếu thành công, bạn sẽ nhận được phản hồi có thông tin sau. Ngoài ra, điểm cuối này hỗ trợ đọc sau khi ghi và có thể trả về ngay bất kỳ trường nào do thao tác đọc trả về.

Tên Mô tả Loại

id

ID bài viết mới tạo

string

Cập nhật

Thao tác này không được hỗ trợ.

Xóa

Thao tác này không được hỗ trợ.