Graph API Version

Conversation /{conversation-id}

A Facebook Messages conversation between a person and a Facebook Page.

Related Guides

Reading

Graph API Explorer
GET /v2.11/{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();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* 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
}];

Permissions

  • A page access token with read_page_mailboxes permission can be used to view any conversation that Page is involved with. The user requesting the page access token must be an admin, editor, or moderator of the page.

  • A user access token with read_mailbox permission can be used to view any conversation that person is involved with if they are a developer of the app making the request.

Fields

NameDescriptionType

id

The ID of a conversation, in a format similar to t_id.000000000000000

string

link

The url to the thread

string

snippet

The snippet of the most recent message in a conversation

string

updated_time

Last update time

datetime

message_count

An estimate of the number of messages

int

unread_count

An estimate of the number of unread messages

int

tags

A set of tags indicating the message folder and source of the conversation

object

name

The name of the message folder or source

string

participants

People and Pages who are on this conversation

Struct { 'name' => string, 'email' => string, 'id' => string }

senders

People who have sent a message

Struct { 'name' => string, 'email' => string, 'id' => string }

can_reply

Whether the Page is able to reply

boolean

is_subscribed

Whether the Page is subscribed to the conversation

boolean

The thread_key and thread_id as well as associated Messages Webhooks are deprecated in v2.11 and higher.

The Conversations edge is not a Time-Based edge. To view conversations, use the Graph Explorer to view the page conversations, {page-id}?fields=converstations.

GET graph.facebook.com/{page_id}?fields=conversations{id}

returns:

{
  "conversations": {
    "data": [
      {`
        "id": "t_mid.$cAATOytD4V3tjZOQonFdM57fgeSgG"
      },
      {
        "id": "t_mid.$cAASUPnuf0OxjZPcEtVdM7G7LfNw1"
      }
    ],
    ...

Click on the id and search the messages field to view a specific conversation:

GET graph.facebook.com/{id}?fields=messages{message}

returns:

  "messages": {
    "data": [
      {
        "message": "Hello World!",
        ...
      }   

Publishing

You can't publish using this edge.

Deleting

You can't delete using this edge.

Updating

You can't update using this edge.

Edges

NameDescriptionUsed to Publish

/messages

List of all messages in the conversation

Replies (by Pages only)