Graph API Version

Thread /{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 object.

Reading

Graph API Explorer
GET /v4.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
}];

Permissions

  • A user access token with read_mailbox permission for any threads involving that person.
  • The user must be a developer of the app making the request.

Fields

NameDescriptionType

id

The unique ID for this message thread.

string

former_participants

Former thread participants who have unsubscribed from the thread.

Profile[]

message_count

Number of messages in the thread.

integer

messages

The messages in this thread.

Message[]

participants

Profiles that are subscribed to the thread.

Profile[]

senders

Profiles that have sent a message in the thread.

Profile[]

snippet

Short text snippet of the latest message in the thread.

string

tags

Thread tags that supply metadata about the thread.

string[]

unread_count

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

integer

updated_time

When the thread was last updated.

datetime

Publishing

You can't create a thread using the Graph API.

Deleting

You can't delete a thread using the Graph API.

Updating

You can't update a thread using the Graph API.