图谱 API 版

/{object-id}/private_replies

对于 v5.0 及更高版本,已停用旧版私信回复

我们已于 2019 年 10 月 29 日宣布已停用此端点。请使用新版私信回复

作为 V3.3 变更的一部分,我们已停用 read_page_mailboxes 权限。请使用 pages_messaging 权限来访问此端点。我们将于 2020 年 6 月 30 日后停用 read_page_mailboxes 权限

此连线是旧版私信回复,公共主页可借此使用纯文本消息回复帖子评论和访客帖子。此连线可与下列节点配合使用:

请注意,一条评论或帖子只能回复一次。

读取

您无法使用此连线读取。

发布

若要以私信形式回复:

POST /v19.0/{object-id}/private_replies HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{object-id}/private_replies',
    array (),
    '{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}/private_replies",
    "POST",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{object-id}/private_replies",
    null,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{object-id}/private_replies"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

可在用户帖子或评论创建之日起 7 天内对帖子或评论进行私信回复。

权限

此连线需要包含下列权限的主页访问口令:

  • pages_messaging

系统将处于开发模式的应用限制为只能向在该应用中具有身份的用户发送消息。此外,系统只允许处于 unpublished 状态的公共主页向在该主页上具有身份的用户发送消息。

字段

参数 说明 类型

id

您正在回复的主页评论或访客帖子之编号。

string

message

回复文本。此为必填字段

string

响应

如果成功,您会收到包含以下字段的响应。此外,此端点支持先写入后读取,并可即时读取返回类型中由 id 表示的节点。

字段 说明 类型

编号

新创建的消息编号。

string

删除

您无法使用此连线进行删除。

更新

您无法使用此连线更新评论。