เวอร์ชันของ API กราฟ

/{object-id}/sharedposts

ข้อมูลอ้างอิงนี้จะอธิบายเกี่ยวกับจุดเชื่อมโยง /sharedposts ซึ่งมักใช้กับโหนด API กราฟหลายรายการ โดยแต่ละโหนดจะมีโครงสร้างและการดำเนินการแบบเดียวกัน อ็อบเจ็กต์ต่อไปนี้มีจุดเชื่อมโยง sharedposts

  • โพสต์บนเพจ
  • โพสต์
  • ผู้ใช้

การอ่าน

สิทธิ์การอนุญาต

  • โทเค็นการเข้าถึงผู้ใช้ที่มีสิทธิ์การอนุญาต user_posts โดยเป็นโทเค็นสำหรับผู้ที่สามารถดูโพสต์ได้หลังจากที่มีการตั้งค่าความเป็นส่วนตัว ระบบจะส่งคืนโพสต์หาก (ก) แอพสร้างโพสต์ หรือ (ข) ครีเอเตอร์ของโพสต์ให้สิทธิ์การอนุญาต user_posts แก่แอพ

สิทธิ์การอนุญาตฟีเจอร์

ชื่อคำอธิบาย

สิทธิ์การเข้าถึงเนื้อหาแบบสาธารณะของเพจ

ต้องได้รับสิทธิ์การอนุญาตฟีเจอร์นี้

ข้อจำกัด

  • ไม่สามารถใช้งาน /{album-id}/sharedposts ได้
  • เราได้เลิกใช้ตำแหน่งข้อมูล GET /{photo-id}/sharedposts แล้ว ตั้งแต่เวอร์ชั่น 8.0 เป็นต้นไป

ตัวอย่าง

Graph API Explorer
GET /v19.0/{object-id}/sharedposts 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(
    '/{object-id}/sharedposts',
    '{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(
    "/{object-id}/sharedposts",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{object-id}/sharedposts",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{object-id}/sharedposts"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

ช่อง

รายการอ็อบเจ็กต์โพสต์ที่แสดงถึงการแชร์แต่ละครั้ง

การเผยแพร่

คุณไม่สามารถเผยแพร่การแชร์ของอ็อบเจ็กต์โดยใช้ API กราฟได้

การลบ

คุณไม่สามารถลบการแชร์ของอ็อบเจ็กต์โดยใช้ API กราฟได้