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.10/{conversation-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{conversation-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* 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.
  • 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

thread_id

The old ID of a conversation, in the same format as id, t_id.000000000000000.

string

thread_key

The new ID of a conversation, in a format similar to t_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

The number of messages.

int

unread_count

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 Conversations edge is moving to a new ID. This breaking change is documented here.

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)