เวอร์ชันของ 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 โพสต์ต่อปี
    • คุณสามารถอ่านโพสต์บนฟีดที่มีช่อง limit ได้สูงสุด 100 รายการเท่านั้น หากคุณพยายามอ่านเกินกว่าที่กำหนด คุณจะได้รับข้อความแสดงข้อผิดพลาดไม่ให้เกิน 100
  • CTA ข้อความ - ผู้ใช้ไม่สามารถใช้โทเค็นการเข้าถึงของเพจอื่นเพื่อเข้าถึงโพสต์ที่มี CTA ข้อความได้ เนื่องจากเพจต่างๆ ไม่สามารถส่งข้อความถึงเพจอื่นได้
  • ข้อมูลที่ระบุตัวบุคคลได้แบบสาธารณะ - ข้อมูลผู้ใช้จะไม่รวมอยู่ในข้อความตอบกลับต่างๆ เว้นแต่คุณจะสร้างคำขอด้วยโทเค็นการเข้าถึงเพจ
  • โพสต์ที่แชร์ - โพสต์บนเพจที่แชร์โพสต์มาจากเพจหรือบุคคลอื่นอาจไม่ปรากฏให้เห็น หากโพสต์ต้นฉบับไม่ได้ปรากฏให้เห็นเมื่อใช้โทเค็นการเข้าถึง
  • โพสต์ที่แท็ก - เมื่อคุณใช้ /{page-id}/tagged เพื่อแสดงโพสต์ที่แท็กเพจนี้ ผลลัพธ์จะรวมโพสต์จากเพจอื่นก็ต่อเมื่อเพจเหล่านั้นเป็นเพจที่แท้จริง
  • ตัวแทนผู้ใช้ - ตัวแทนผู้ใช้ที่ใช้งานได้ซึ่งได้รับอนุญาตสำหรับการเรียกใช้ API กราฟเหล่านี้อาจมีการเปลี่ยนแปลงได้โดยไม่ต้องแจ้งให้ทราบ หากคุณกำลังประสบปัญหา คุณอาจต้องเปลี่ยนตัวแทนผู้ใช้เฉพาะของคุณเป็นเวอร์ชั่นที่ใหม่กว่า
  • โพสต์แบบวิดีโอ - ระบบจะส่งกลับเฉพาะช่อง source สำหรับ /page/feed และ /page/posts สำหรับวิดีโอที่เพจเป็นเจ้าของเมื่อผู้ใช้ที่สร้างคำขอเป็นผู้ดูแลเพจที่เป็นเจ้าของนั้นเอง

พารามิเตอร์

จุดสิ้นสุดนี้ไม่ต้องพารามิเตอร์ใดๆ

ช่อง

การอ่านจากจุดเชื่อมโยงนี้จะให้ผลลัพธ์ที่อยู่ในรูปแบบ 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
3001Invalid query

การสร้าง

คุณไม่สามารถดำเนินการนี้ที่ปลายทางนี้

กำลังอัพเดต

คุณไม่สามารถดำเนินการนี้ที่ปลายทางนี้

กำลังลบ

คุณไม่สามารถดำเนินการนี้ที่ปลายทางนี้