Graph API Version

Message

An individual message in Facebook Messenger. This is a Pages-only endpoint.

It's not possible to request a message by its individual message ID. Instead you should get the message as part of the thread it's part of.

Reading

Graph API Explorer
GET /v2.7/{message-id} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
$request = new FacebookRequest(
  $session,
  'GET',
  '/{message-id}'
);
$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */
/* make the API call */
FB.api(
    "/{message-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{message-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:@"/{message-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 is required.

Fields

NameDescriptionType

created_time

A timestamp of when this message was created

datetime

from

The sender of this message.

Profile

id

The unique ID for this message.

string

message

The text of the message.

string

subject

The subject of the message.

string

tags

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

object[]

to

A list of recipients of the message.

Profile[]

Edges

NameDescription

/attachments

Files attached to a message.

/shares

Shared items, including links, photos, videos, and stickers.