Private Replies

New feature

On September 30, 2019 we made improvements to private replies. The old Private Replies only allowed plain text to be sent. With this update businesses can send images, templates and quick replies as part of the message they send in response to a post or comment on their Page.

Private Replies allows Businesses to reply to Post Comments and Visitor Posts made on their Page with a single message on Messenger.

The message is sent just like any regular message using the Send API but referencing either the Page Post of comment that will be replied.

When using this feature, the user will get a reference with a link to the post or comment that is getting the reply.

Private replies to posts or comments are allowed within 7 days of the creation date of the user post or comment.

Permissions

A page access token with pages_messaging permission is required to interact with this endpoint.

Apps in Development Mode, are restricted to message people that have a role in the app. Additionally Pages in unpublished status will only be allowed to message people with a role on the Page.

Further permissions to get Page Visitors Posts and Post comments

This endpoint does not need any other permission than pages_messaging, yet it does need a reference to either a post id or a comment id. Those references are typically obtained via webhook subscriptions to Page feed field, to get this subscription manage_pages is needed. See Pages Webhook

Example Request

curl -X POST -H "Content-Type: application/json" -d '{
    "recipient": {
        "post_id": "542998526103632_461184817813069"
    },
    
    "message": {
      "attachment":{
        "type":"template",
        "payload":{
          "template_type":"button",
          "text":"Of course, what is your budget for the gift?",
          "buttons":[
              {
                  "content_type": "text",
                  "title": "LESS THAN $20",
                  "payload": "GIFT_BUDGET_20_PAYLOAD"
              },
              {
                  "content_type": "text",
                  "title": "$20 TO $50",
                  "payload": "GIFT_BUDGET_20_TO_50_PAYLOAD"
              },
              {
                  "content_type": "text",
                  "title": "MORE THAN $50",
                  "payload": "GIFT_BUDGET_50_PAYLOAD"
              }
          ]
        }
      }
    }
}' "https://graph.facebook.com/v5.0/me/messages?access_token=<PAGE_ACCESS_TOKEN>"

Recipient

Private replies allows the Page to reply to the following activity:

  • Comment
  • Post

The app must specify one of the two in order to indicate which activity the Page is replying to.

Activity Type Property Description

Page Post

recipient.post_id

A visitors post, to reply to.

Page Post Comment

recipient.comment_id

A visitors comment on a Page post to reply to.

Message

The message payload can contain any supported message type, like plain text, templates and quick replies. For a full reference on all supported message payloads see Send API Reference