Graph API Version

Message

An individual message in Facebook Messenger.

Use the conversation thread endpoint or Webhooks for Pages to retrieve the individual message IDs.

Reading

Graph API Explorer
GET /v8.0/{message-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(
    '/{message-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(
    "/{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
}];

Requirements

TypeDescription

App Review

Your app must be be approved for the following login permissions and features.

Features

Not applicable

Tokens

A Page access token from a person who can perform the MODERATE task on the Page being queried.

Permissions

The pages_messaging permission

The pages_manage_metadata permissiona>

As part of the V3.3 changes the read_page_mailboxes permission was deprecated. Use pages_messaging permission to access this endpoint. The read_page_mailboxes permission will stop working after June 30 2020.

Limitations

  • To get stickers you must include the /shares{link} edge in your request.
  • This is a Pages only endpoint.

Fields

Name Description Type

created_time

A timestamp of when this message was created

datetime

from

The sender of this message. In some cases the name of the user will resolve to "Facebook User" in order to protect user privacy.

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

Name Description

/attachments

Files attached to a message.

/shares

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

Create

You can't perform this operation on this endpoint.

Update

You can't perform this operation on this endpoint.

Delete

You can't perform this operation on this endpoint.