图谱 API 版

Page Published Posts

读取

PagePublishedPosts

New Page Experience

This endpoint is supported for New Page Experience.

Feature Permissions

名称描述
公共主页公开内容访问权限This feature permission may be required.

例子

Graph API Explorer
GET /v26.0/{page-id}/published_posts 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(
    '/{page-id}/published_posts',
    '{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(
    "/{page-id}/published_posts",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{page-id}/published_posts",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{page-id}/published_posts"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
如果你希望详细了解如何使用图谱 API,请阅读我们的图谱 API 指南

限制

  • 最大帖子读取量
    • API 每年返回大约 600 个经排名的已发布帖子。
    • 由于 limit 字段的限制,您最多只能读取 100 个动态帖子。如果尝试读取更多帖子,您会收到告知您不要超过 100 个帖子的错误消息。
  • 消息行动号召 (CTA) - 由于公共主页无法向其他公共主页发送消息,因此您无法使用其他公共主页的访问口令访问带有消息行动号召 (CTA) 的帖子。
  • 公开的身份识别信息 - 除非您使用公共主页访问口令发出请求,否则响应中不会包含用户信息。
  • 分享的帖子 - 如果原始帖子无法通过所使用的访问口令查看,则分享其他公共主页或用户帖子的公共主页帖子也可能不可见。
  • 标记的帖子 - 当您使用 /{page-id}/tagged 来显示标记过此公共主页的帖子时,显示结果会包含来自其他公共主页的帖子,但前提是这些公共主页必须真实可信。
  • 用户代理 - 这些图谱 API 调用允许的可用用户代理如有更改,恕不另行通知。如果遇到问题,您可能需要更改为更新版本的特定用户代理。
  • 视频帖 - 仅当发出请求的用户是公共主页的管理员时,系统才会为该主页拥有的视频返回 /page/feed/page/postssource 字段。

参数

这个端点不包含任何参数。

字段

从这条连线读取将返回一个 JSON 格式的结果:

{ "data": [], "paging": {}, "summary": {} }

data

PagePost 节点列表。

paging

详细了解分页功能,请见图谱 API 指南

summary

关于连线的汇总信息(例如次数总计)。请指定字段来调取概要中的参数(例如:概要=total_count)。

字段说明
total_count
unsigned int32

total_count

错误代码

错误描述
80001There have been too many calls to this Page account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting.
100Invalid parameter
200Permissions error
210User not visible
190Invalid OAuth 2.0 Access Token
283That action requires the extended permission pages_read_engagement and/or pages_read_user_content and/or pages_manage_ads and/or pages_manage_metadata
104Incorrect signature
2500Error parsing graph query

创建

你无法在此端点执行该操作。

更新

你无法在此端点执行该操作。

删除

你无法在此端点执行该操作。