圖形 API 版本

/{object-id}/private_replies

5.0 以上版本已停用舊版私人回覆

我們在 2019 年 10 月 29 日宣佈現已停用此端點。請使用新的私人回覆

read_page_mailboxes 權限是 V3.3 變更的一部分,已遭停用。使用 pages_messaging 權限可存取此端點。read_page_mailboxes 權限將在 2020 年 6 月 30 日之後停止運作

這個關係連線為舊版私人回覆,可讓粉絲專頁使用純文字訊息回覆貼文留言和訪客貼文,能夠搭配以下節點使用:

請注意,只能回覆一次留言或貼文。

讀取

您無法使用這個關係連線讀取。

發佈

使用私人訊息回覆:

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 狀態的粉絲專頁僅能傳送訊息給在該粉絲專頁上擁有角色的人。

欄位

參數 說明 Type

id

回覆中的粉絲專頁留言或訪客貼文編號。

string

message

回覆的文字。這是必要欄位

string

回應

成功時,您會收到具有以下欄位的回應。此外,此端點支援寫入後讀取功能,可立即讀取回傳類型中 id 代表的節點。

欄位 說明 類型

id

新建訊息的編號。

string

刪除

您無法使用這個關係連線刪除。

更新

您無法使用這個關係連線更新。