Graph API 版本

Page Published Posts

閱讀中

PagePublishedPosts

新版專頁體驗

This endpoint is supported for 新版專頁體驗.

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
}];
如果想了解如何使用 Graph API,請參閱我們的使用 Graph API 指南

限制

  • 帖子數量上限
    • API 每年傳回約 600 個已排名和已發佈的帖子。
    • 由於 limit 欄位有所限制,您最多只能讀取 100 個動態消息帖子。如果嘗試讀取更多帖子,您會收到告知您不要超過 100 個帖子的錯誤訊息。
  • 訊息呼籲字句 - 由於專頁無法向其他專頁傳送訊息,您無法使用其他專頁的存取憑證來存取含有訊息呼籲字句的帖子。
  • 可公開識別身分的資訊 - 除非您使用專頁存取憑證提出要求,否則用戶資訊不會包含在回應中。
  • 分享帖子 - 此類專頁帖子會分享來自其他專頁或用戶的帖子;如果您使用存取憑證時看不到原本的帖子,則您亦將無法查看此帖子。
  • 標註帖子 - 當您使用 /{page-id}/tagged 來顯示標註過此專頁的帖子時,顯示結果會包含來自其他專頁的帖子,但前提是這些專頁必須為真實。
  • 用戶代理 - 這些 Graph API 呼叫允許的可用用戶代理可能會在無另行通知的情況下隨時變更。如果遇到問題,您可以嘗試變更至特定用戶代理的較新版本。
  • 影片帖子 - 如果提出要求的用戶是專頁的管理員,系統僅會為專頁擁有的影片傳回 /page/feed/page/postssource 欄位。

參數

這個端點沒有任何參數。

欄位

由此關係連線進行的閱讀將回傳 JSON 格式結果:

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

data

PagePost 節點的清單。

paging

如需更多有關分頁的詳細資料,請參閱 Graph API 指南

summary

與關係連線相關的彙總資訊,例如次數等。請在摘要參數中指定要擷取的欄位(例如 summary=total_count)。

欄位說明
total_count
unsigned int32

total_count

Error Codes

錯誤說明
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

建立中

你無法在此端點執行此操作。

更新中

你無法在此端點執行此操作。

正在刪除

你無法在此端點執行此操作。