圖形 API 版本

Page Published Posts

閱讀中

All published posts by the page.

新粉絲專頁體驗

This endpoint is supported for 新粉絲專頁體驗.

Feature Permissions

名稱說明
粉絲專頁公開內容存取權限This feature permission may be required.

範例

Graph API Explorer
GET /v19.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 則已排序且已發佈的貼文。
    • 您最多只能讀取 100 則含有 limit 欄位的動態貼文。若嘗試讀取更多數量,將會收到無法顯示超出 100 則貼文的錯誤訊息。
  • 訊息 CTA:無法使用其他粉絲專頁的存取權杖來存取具有訊息 CTA 的貼文,因為粉絲專頁不能對其他粉絲專頁傳送訊息。
  • 公開識別資訊:回應不會包含用戶資訊,除非您以粉絲專頁存取權杖提出要求。
  • 分享的貼文:若原始貼文因使用存取權杖而無法顯示,則無法顯示分享自其他粉絲專頁或用戶的粉絲專頁貼文。
  • 標註的貼文:使用 /{page-id}/tagged 來顯示標註此粉絲專頁的貼文時,結果會包含其他粉絲專頁的貼文(必須經過驗證)。
  • 用戶代理程式:這些圖形 API 呼叫可用的用戶代理程式,如有變更,將不另行通知。若您碰到問題,可能要將某個用戶代理程式變更為更新的版本。
  • 影片貼文:提出要求的用戶在擁有的粉絲專頁是管理員時,將不再針對粉絲專頁擁有的影片傳回 /page/feed/page/postssource 欄位。

參數

這個端點沒有任何參數。

欄位

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

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

data

PagePost 節點的清單。

paging

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

summary

與關係連線相關的彙總資訊,例如次數等。請在摘要參數中指定要擷取的欄位(例如 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

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.
200Permissions error
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
100Invalid parameter
210User not visible
104Incorrect signature

建立中

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

更新中

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

刪除中

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