Graph API 版本

/{object-id}/private_replies

5.0 版及更高版本已停用舊版私人回覆功能

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

作為 3.3 版變更的一部分,我們已停用 read_page_mailboxes 的權限。請使用 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 狀態的專頁,只允許其對該專頁上具有角色的用戶傳送訊息。

欄位

參數 描述 類型

id

您正在回覆的專頁回應或訪客帖子之編號。

string

message

回覆的文字。此為必填欄位

string

回應

成功的話,您將會收到包含以下欄位的回應。此外,此端點支援先寫入後讀取,並可即時讀取傳回類型中由 id 代表的節點。

欄位 描述 類型

編號

新建立的訊息編號。

string

刪除

您無法使用此邊緣刪除內容。

更新

您無法使用此邊緣作出更新。