图谱 API 版

链接 /{link-id}

分享到 Facebook 的链接。

读取

图谱 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

发布

请使用分享文档来发布。

更新

您无法使用图谱 API 更新链接。

连线

名称 说明

/likes

为此链接点赞的用户。

/comments

对此链接发表的评论。