This documents shows you how to programmatically add the Private Replies to your messaging experience.
How It WorksPrivate Replies allows an Instagram Professional account to send a single message to a person who commented on your Instagram Professional post, ads post, reel, or live story. When you receive a You can send this private reply within 7 days of the creation time of the comment, excepting Instagram Live for which you can only send a private reply during the live broadcast. The message will contain a link to the post that the person commented on. |
live_comments
webhooks events, via the Instagram API,
and that your system can differentiate between live_comments
and comments
notifications.
comments
webhooks notifications for ads posts will include the ID and title for the ad. You may need to update your webhooks server to handle these new fields.
The ad_id
and ad_title
will be returned in the media object when a person comments on a boosted Instagram post or Instagram ads post. This may result in duplicate webhook notifications.
This tutorial assumes you have read the Messenger Platform Overview and the Instagram Messaging Overview and implemented the needed components.
You will need:
comments
webhooks, for posts, ads posts, and reels, and Instagram live_comments
webhooks for live stories (recommended to avoid rate limiting) or an API call to the /page/feed
endpointinstagram_manage_comments
and pages_messaging
permissions, obtained via Facebook LoginMESSAGING
task on the Facebook Page linked to your Instagram Professional accountTo send a private reply to a person who commented on your post, reel, or live story, send POST
request to the /PAGE-ID/messages
endpoint where the recipient
parameter contains the comment ID and the message
parameter contains the text you wish to send.
curl -i -X POST "https://graph.facebook.com/PAGE-ID/messages
?recipient: { comment_id: COMMENT-ID }
&message: { "text": "Thanks for reaching out, how can I help?" }
&access_token=PAGE-ACCESS-TOKEN"
On success, your app will receive the following response:
{ "recipient_id": "526...", // The Instagram-scoped ID "message_id": "aWdfZ..." // The message ID for your private reply }