圖形 API 版本

社團

Facebook 社團

讀取

傳回與單一社團物件相關的資訊。請改用 /user/groups 關係連線取得社團和用戶管理員清單。

圖形 API 測試工具
GET /v19.0/{group-id} 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}',
    '{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}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{group-id}",
    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}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

權限

  • groups_access_member_info:讓您的應用程式能夠接收攸關社團內容的成員相關資料。
  • publish_to_groups:讓您的應用程式能夠代表用戶在社團中發佈內容。

公開社團和不公開社團

用戶存取權杖

私密社團

社團管理員的用戶存取權杖

注意事項

  • 除非使用社團管理員的存取權杖提出要求,否則任何回應一律不會包含會傳回用戶資訊的欄位。

欄位

屬性名稱 說明 Type

id

社團編號

string

cover

社團封面相片相關資訊。

CoverPhoto

id

代表這張封面相片的相片編號。

string

source

代表這張封面相片的相片網址。

string

offset_y

從底部算起的相片垂直調整值,單位是像素。

int

offset_x

從左側算起的相片水平調整值,單位是像素。

int

description

社團的簡要說明。

string

email

將內容上傳至社團所用的電子郵件地址。只有社團既有成員才能使用此功能。

string

icon

社團圖示的網址。

string

member_count

社團成員人數。

int

member_request_count

待批准成員邀請數量。必須要有社團管理員的存取權杖。待批准成員邀請數量超過 50 個才會傳回數目。

int

name

社團名稱。

string

owner

在 9.0 以上版本中已停用,並將於 2021 年 2 月 9 日在所有版本中停用。

User | Page

parent

此社團若有上層社團,即指該上層社團。

Group | Page

permissions

用戶授予社團所安裝之應用程式的權限。

string

privacy

社團的隱私設定。可能的值為 CLOSEDOPENSECRET。必須要有社團管理員的存取權杖。

string

updated_time

社團上次更新時間(包括變更社團屬性、貼文及留言)。必須要有社團管理員的存取權杖。

datetime

建立

不支援執行此作業。

更新

不支援執行此作業。

刪除

不支援執行此作業。

關係連線

名稱 說明

/admins

此關係連線已於 2018 年 4 月 4 日停用。

/albums

社團擁有的相簿。

/docs

社團擁有的文件。

/events

社團擁有的活動。

/feed

社團擁有的貼文動態。

/files

社團擁有的檔案。

/live_videos

社團擁有的直播視訊。

/members

此關係連線已於 2018 年 4 月 4 日停用。

/photos

社團擁有的相片。

/videos

社團擁有的影片。