Graph API 版本

連結 /{link-id}

分享到 Facebook 的連結。

讀取

Graph API 測試工具
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

連結編號。

string

created_time

訊息的發佈時間。

datetime

description

連結的描述(顯示於連結說明文字下方)。

string

from

建立連結的用戶。

User

icon

Facebook 在動態消息中展示的連結圖示網址。

string

link

分享的網址。

string

message

來自用戶、關於此連結的可選訊息。

string

name

連結名稱。

string

picture

連結帖子所使用的縮圖網址

string

reactions


已在 v8.0 版及以上版本中停用。

對連結表達的心情:讚好、勁正、嘩、哈哈、抱歉、嬲嬲、無任何心情。

string

發佈

請使用分享文件來發佈。

更新

您無法使用 Graph API 更新連結。

關係連線

名稱 說明

/likes

讚好此連結的用戶。

/comments

為此連結發表的回應。