/{thread-id}
A Facebook Messages conversation thread. This endpoint is only accessible for users that are developers of the app making the request.
Pages should use the Conversation endpoint.
Get a message thread.
MODERATE
task on the Page.GET /v21.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
}];
Name | Description | Type |
---|---|---|
| The unique ID for this message thread. |
|
| The messages in this thread. | |
| Profiles that are subscribed to the thread. | |
| The amount of messages that are unread by the session profile. |
|
| The amount of messages that are unseen by the session profile. |
|
| When the thread was last updated. |
|
| Can the page reply in the thread. |
|
| ID of the Workplace group that the thread is linked to (Workplace only) |
|
Name | Description |
---|---|
| List of individual messages in the thread. See Messages |
The messages
connection can be filtered to avoid pulling text that is part of thread warnings by the Messenger Apps. This is done via the source
filter there only participants might be selected.
If this filter is not apply admin text (gray text appears in the thread by Messenger) will be retrieved as well.
This call will retrieve the last 3 messages made only by the participants.
curl -i -X GET \ "https://graph.facebook.com/v4.0/t_10155839492600149?fields=id,messages.source(PARTICIPANTS).limit(3)&access_token=<Access Token>"
You can't perform this operation on this endpoint.
You can't perform this operation on this endpoint.
You can't perform this operation on this endpoint.