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

ลิงก์ /{link-id}

ลิงก์ที่แชร์บน Facebook

การอ่าน

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

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

  • ต้องมีโทเค็นการเข้าถึงที่ใช้ได้ หากเป็นลิงก์สาธารณะ

ช่อง

ชื่อ คำอธิบาย ประเภท

id

ID ลิงก์

string

created_time

เวลาที่เผยแพร่ข้อความ

datetime

description

คำอธิบายของลิงก์ (แสดงใต้คำบรรยายลิงก์)

string

from

ผู้ใช้ที่สร้างลิงก์

User

icon

URL ไปยังไอคอนลิงก์ที่ Facebook แสดงในฟีด

string

link

URL ที่แชร์

string

message

ข้อความจากผู้ใช้เกี่ยวกับลิงก์นี้ ซึ่งจะระบุหรือไม่ก็ได้

string

name

ชื่อลิงก์

string

picture

URL ไปยังภาพขนาดย่อที่ใช้ในโพสต์ลิงก์

string

reactions


เลิกใช้ในเวอร์ชั่น 8.0 ขึ้นไป

ความรู้สึก, การกดถูกใจ, รักเลย, ว้าว, ฮ่าๆ, เสียใจ, โกรธ และการไม่แสดงความรู้สึกใดๆ ต่อลิงก์

string

การเผยแพร่

โปรดใช้เอกสารประกอบเกี่ยวกับการแชร์เพื่อเผยแพร่

การอัพเดต

คุณไม่สามารถอัพเดตลิงก์โดยใช้ API กราฟได้

จุดเชื่อมโยง

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

/likes

ผู้ที่ถูกใจลิงก์นี้

/comments

ความคิดเห็นบนลิงก์นี้