All published posts by the page.
名称 | 描述 |
---|---|
公共主页公开内容访问权限 | This feature permission may be required. |
GET /v21.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
}];
limit
字段的限制,您最多只能读取 100 个动态帖子。如果尝试读取更多帖子,您会收到告知您不要超过 100 个帖子的错误消息。/{page-id}/tagged
来显示标记过此公共主页的帖子时,显示结果会包含来自其他公共主页的帖子,但前提是这些公共主页必须真实可信。/page/feed
和 /page/posts
的 source
字段。从这条连线读取将返回一个 JSON 格式的结果:
{ "
data
": [], "paging
": {}, "summary
": {} }
data
paging
summary
关于连线的汇总信息(例如次数总计)。请指定字段来调取概要中的参数(例如:概要=total_count
)。
字段 | 说明 |
---|---|
total_count unsigned int32 | The approximate total number of published posts within the specified time window, requires since parameter to be specified |
错误 | 描述 |
---|---|
80001 | There 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. |
200 | Permissions error |
100 | Invalid parameter |
190 | Invalid OAuth 2.0 Access Token |
210 | User not visible |
283 | That action requires the extended permission pages_read_engagement and/or pages_read_user_content and/or pages_manage_ads and/or pages_manage_metadata |
104 | Incorrect signature |
3001 | Invalid query |
2500 | Error parsing graph query |