圖形 API 版本

對話 /{conversation-id}

用戶與 Facebook 粉絲專頁或 Instagram 專業帳號之間的訊息對話。

讀取

圖形 API 測試工具
GET /v19.0/{conversation-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(
    '/{conversation-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(
    "/{conversation-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{conversation-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:@"/{conversation-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

權限

Instagram 傳訊還需要:

限制

  • 查詢這個 Instagram 傳訊端點時會傳回對話的所有訊息。不過,您只能查詢對話中最近 20 則訊息的資料。若您所查詢的訊息非最近 20 則訊息,會傳回錯誤,註明已刪除該則訊息。

欄位

名稱 說明

id

字串

對話的編號

messages

字串

對話中的訊息

participants

物件

id


email

粉絲專頁傳訊限定

name

粉絲專頁傳訊限定

username

Instagram 傳訊限定

對話參與者


您的 Instagram 專業帳號或粉絲專頁編號之用戶或 Instagram 編號的 Instagram 範圍編號或粉絲專頁範圍編號。

用戶或粉絲專頁的電子郵件


用戶或粉絲專頁的名稱


用戶或您的 Instagram 專業帳號的 Instagram 用戶名稱

updated_time

日期時間

在對話中新增最近一則訊息的時間

若要取得對話中某一則特定訊息的相關資訊,請傳送要求至訊息端點

發佈

您無法使用這個關係連線發佈內容。

請使用 Messenger 開放平台來傳送範本快速回覆等等。

刪除

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

更新

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

關係連線

名稱 說明 用於發佈

/messages

對話中的所有訊息清單

回覆次數(僅按粉絲專頁計算)