图谱 API 版

小组文档 /{group-doc-id}

表示 Facebook 小组中的某个文档。/{group-doc-id} 节点可返回单个文档。

读取

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

权限

  • 如果小组是公开小组(即小组的隐私设置为 OPEN),则需要任意有效的访问口令

字段

属性名称 描述 类型

id

小组文档的编号。

string

from

创建此文档的个人主页。

User|Page

subject

文档的标题。

string

message

文档的正文。此字符串将包含文档中任何格式设置的 HTML 并经过 HTML 编码。

string

icon

文档图标的网址

string

created_time

文档的创建时间。

datetime

updated_time

上一次更改文档的时间。

datetime

revision

表示当前文档修订版的编号。

int

can_edit

会话用户能否编辑此文档。

boolean

can_delete

会话用户能否(在 Facebook.com 上)删除此文档。

boolean

embedded_urls

文档嵌入的网址

[string]

发布

您无法通过图谱 API 创建文档。

删除

您无法通过图谱 API 删除文档。

更新

您无法通过图谱 API 更新文档。