圖形 API 版本

貼文串 /{thread-id}

Facebook 訊息對話貼文串。

粉絲專頁應使用對話端點

讀取

取得訊息貼文串。

權限

範例

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

Fields

名稱 說明 Type

id

此訊息貼文串的專屬編號。

string

comments

此貼文串中的訊息。

Message[]

to

訂閱貼文串的個人檔案。

Profile[]

unread

The amount of messages that are unread by the session profile.

integer

unseen

The amount of messages that are unseen by the session profile.

integer

updated_time

貼文串上次更新的時間。

datetime

can_reply

粉絲專頁可以在貼文串中回覆。

boolean

linked_group

貼文串連結的 Workplace 群組編號(僅限 Workplace)

string

關係連線

名稱 說明

messages

貼文串中的個別訊息清單。

過濾訊息

Messenger 應用程式可以篩選 messages 連線,以避免擷取出貼文串警告中的文字。這是透過 source 篩選條件來完成,只能選取參與者。

如果未套用此篩選條件,則也會擷取管理員文字(Messenger 貼文串中的灰色文字)。

範例

此呼叫只會擷取參與者發出的最後 3 則訊息。

curl -i -X GET \
 "https://graph.facebook.com/v4.0/t_10155839492600149?fields=id,messages.source(PARTICIPANTS).limit(3)&access_token=<Access Token>"

發佈

您無法在這個端點執行此操作。

Deleting

您無法在這個端點執行此操作。

更新

您無法在這個端點執行此操作。