Skip to content

Commit 1ef12f9

Browse files
sbhat222facebook-github-bot
authored andcommitted
Add description for quick replies and private replies
Summary: Add detailed description to the quick reply and private reply apis Differential Revision: D81650257 fbshipit-source-id: 6a643916de11f601feb99097836ab91dee889f2b
1 parent 6612674 commit 1ef12f9

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

postman/instagram-platform-api.postman_collection.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1152,7 +1152,8 @@
11521152
"{{ig_user_id}}",
11531153
"messages"
11541154
]
1155-
}
1155+
},
1156+
"description": "# Quick Replies\n\n| A Quick Reply is a preset button that allows a user to quickly reply to a prompt or question within a conversation. When a quick reply is tapped, the buttons are dismissed, and the title of the tapped button is posted to the conversation as a message. A messages event will be sent to your webhook that contains the button title and an optional payload. | <img src=\"https://scontent-lax3-1.xx.fbcdn.net/v/t39.2365-6/118773999_346285803169041_8806208626533285146_n.png?_nc_cat=105&amp;ccb=1-7&amp;_nc_sid=e280be&amp;_nc_ohc=o-6sEb0pAD4Q7kNvwH6dwh4&amp;_nc_oc=AdlUD-7_QFWK0hie_tK-nvBkzdHs4mTnKhI8DKkCOHGZGoZHCd_DCJSSa-zZlM1e3hQjAz2SbC3e0HSJeCiDkuH4&amp;_nc_zt=14&amp;_nc_ht=scontent-lax3-1.xx&amp;_nc_gid=cuNeXMnWbL5xXCgRGWgP3A&amp;oh=00_AfYWyOThR6r0MN4jWRMPWh_7Rs6pXa4q9qUGxnpFpCQiEQ&amp;oe=68D34486\" alt=\"\"> |\n\nYou can have a maximum of 13 buttons that may contain:\n\n- Plain text of up to 20 characters (will be truncated if more than 20)\n \n- Phone number of the recipient, pre-filled with the phone number from the user's profile information\n \n- Email of the recipient, pre-filled with the email from the user's profile information\n \n\nIf you include a phone number or email as a quick reply option, the quick reply button is pre-filled with the phone number or email from the user's profile information. If the user has not supplied a phone number or email in their profile, this quick reply option is not shown.\n\nAn Instagram webhook event notification is sent to your webhook server. The webhook notification contains the button title and an optional payload you set that can include information about the button selected.\n\n## Before you start\n\nThis guide assumes you have set up your webhooks server to receive notifications and subscribed your app to Instagram `messages` and `messaging_postbacks` events.\n\nYou will need:\n\n- The ID for the Instagram Professional account (`IG_ID`)\n \n- The Instagram-scoped ID (`IGSID`) for the person to whom you are sending the message\n \n\n#### Host URL\n\n`https://graph.instagram.com`\n\n### Limitations\n\nThis feature is currently not available on desktop.\n\n- A maximum of 13 quick replies are supported\n \n- A quick reply can contain up to 20 characters before it is truncated\n \n- Only plain text is supported except for pre-filled email or phone number quick replies\n \n- If no email or phone number are supplied by the user, these quick replies are not displayed\n \n- User information, such as email or phone number, is only sent to your app if the user selects an email or phone number quick reply button\n \n\n## Send Quick Replies\n\nTo send a set of quick replies, send a `POST` request to the `//messages` endpoint with the following properties:\n\n- `recipient.id` set to the Instagram-scoped ID for the person receiving the quick replies.\n \n- `message` object with:\n \n - `text` set to the text that will prompt a person to click a quick reply\n \n - `quick_replies` array containing an object for each quick reply:\n \n - `content_type` set to\n \n - `title` set to the quick reply text\n \n - `payload` set to the content you would like to receive about the quick reply in the webhook notification\n \n\n#### Sample Request\n\n_Formatted for readability._\n\n```\ncurl -X POST -H \"Content-Type: application/json\" -d '{\n \"recipient\":{\n \"id\":\"<IGSID>\"\n },\n \"message\":{\n \"text\": \"<THE_PROMPT_OR_QUESTION>\",\n \"quick_replies\":[\n {\n \"content_type\":\"text\",\n \"title\":\"<BUTTON_OPTION_TEXT1>\",\n \"payload\":\" },{\n \"content_type\":\"text\",\n \"title\":\"<BUTTON_OPTION_TEXT2>\",\n \"payload\":\" },{\n \"content_type\":\"user_phone_number\",\n \"title\":\"<PREFILLED_PHONE_NUMBER_IF_AVAILABLE>\",\n \"payload\":\"<POSTBACK_PHONE_NUMBER_PAYLOAD>\"\n },{\n \"content_type\":\"user_email\",\n \"title\":\"<PREFILLED_EMAIL_IF_AVAILABLE>\",\n \"payload\":\"<POSTBACK_EMAIL_PAYLOAD>\"\n }\n ]\n }\n}&#x27; \"https://graph.instagram.com/<API_VERSION>/me/messages?access_token=<INSTAGRAM_ACCESS_TOKEN>\" \n\n ```\n\n## Webhook Event\n\nWhen a quick reply is selected, a notification will be sent to your webhook server that contains the following:\n\n- The ID for the Instagram Professional account that owns the quick replies\n \n- The time the notification was sent\n \n- The Instagram-scoped ID for the person who sent the quick reply\n \n- The payload for the specific quick reply that was selected\n \n- The ID for the message\n \n- The text, email, or phone number of the selected quick reply\n \n\n**Note:** If a user has not supplied their email or phone number in their profile information,\n\n#### Sample Notification\n\n```\n{\n \"object\": \"instagram\",\n \"entry\": [\n {\n \"id\": \"<IGID>\",\n \"time\": 1502905976963,\n \"messaging\": [\n {\n \"sender\": {\n \"id\": \"<IGSID>\"\n },\n \"recipient\": {\n \"id\": \"<IGID>\"\n },\n \"timestamp\": 1502905976377,\n \"message\": {\n \"quick_reply\": {\n \"payload\": \"<POSTBACK_OF_BUTTON_SELECTED>\"\n },\n \"mid\": \"<MESSAGE_ID>\",\n \"text\": \"<PHONE_NUMBER_EMAIL_OR_TEXT_OF_BUTTON_SELECTED>\"\n }\n }\n ]\n }\n ]\n}\n\n ```"
11561157
},
11571158
"response": [
11581159
{
@@ -1194,7 +1195,7 @@
11941195
]
11951196
},
11961197
{
1197-
"name": "Private Reply",
1198+
"name": "Private Replies",
11981199
"request": {
11991200
"method": "POST",
12001201
"header": [],
@@ -1220,7 +1221,8 @@
12201221
"{{ig_user_id}}",
12211222
"messages"
12221223
]
1223-
}
1224+
},
1225+
"description": "This documents shows you how to programmatically send a private reply to a person who commented on your app user's Instagram professional post, reel, story, Live, or ad post.\n\n## How It Works\n\nStep 1. An Instagram user comments on your app user's Instagram professional post, reel, story, Live, or ad post.\n\nStep 2. A webhook event is triggered and Meta sends your server a notification with information about the comment including:\n\n| - Your app user's Instagram professional account ID<br> <br>- The commenter's Instagram-scoped ID and username<br> <br>- The comment's ID<br> <br>- The media's ID, if the commenter included media in their comment<br> <br>- The text of the comment, if applicable<br> <br><br>Step 3. Your app uses the comment's ID to send a private response directly to the Instagram user. This reply appears in the person's **Inbox**, if the person follows the Instagram professional account, or to the **Request** folder, if they do not. | <img src=\"https://scontent-lax3-2.xx.fbcdn.net/v/t39.2365-6/118520113_305452657552386_5531150750029687976_n.jpg?_nc_cat=100&amp;ccb=1-7&amp;_nc_sid=e280be&amp;_nc_ohc=qTs6GBNyzhkQ7kNvwHZr_8T&amp;_nc_oc=Adm_4zTekZ6M8p0JyW7oorCx0Pk3Zyl648d9EYWpAqHDEP1KKJWB1AOicfStbVzrcKv_jcfqMX-rZNbDUGMK1dcp&amp;_nc_zt=14&amp;_nc_ht=scontent-lax3-2.xx&amp;_nc_gid=QOCKIl7JWa2n7v-3_EBbyQ&amp;oh=00_AfYgyqk4FpdY2gibWCNvbMiEq6JtMVCeoOjbZu71EF_suw&amp;oe=68D3430A\" alt=\"\"> |\n\nStep 4. Your app can send this private reply within 7 days of the creation time of the comment, excepting Instagram Live, where replies can only be sent during the live broadcast. The private reply message includes a link to the commented post.\n\n## Requirements\n\nThis guide assumes you have read the [Instagram Platform Overview](https://developers.facebook.com/docs/instagram-platform/overview) and implemented the needed components for using this API, such as a Meta login flow and a webhooks server to receive notifications.\n\nYou need the following:\n\n| | Instagram API with Instagram Login | Instagram API with Facebook Login |\n| --- | --- | --- |\n| **Access Levels** | - Advanced Access<br> <br>- Standard Access | - Advanced Access<br> <br>- Standard Access |\n| **Access Tokens** | - Instagram User access token | - Facebook Page access token |\n| **Host URL** | `graph.instagram.com` | `graph.facebook.com` |\n| **Login Type** | Business Login for Instagram | Facebook Login for Business |\n| [<b>Permissions</b>](https://developers.facebook.com/docs/permissions/reference#i) | - `instagram_business_basic`<br> <br>- `instagram_business_manage_comments` | - `instagram_basic`<br> <br>- `instagram_manage_comments`<br> <br>- `pages_read_engagement`<br> <br><br>If the app user was granted a role on the [Page](https://developers.facebook.com/docs/instagram-api/overview#pages) connected to your app user's Instagram professional account via the Business Manager, your app will also need:<br><br>- `ads_management`<br> <br>- `ads_read` |\n| **Webhooks** | - `comments`<br> <br>- `live_comments` | - `comments`<br> <br>- `live_comments` |\n\n### Limitations\n\n- Only one message can be sent to the commenter\n \n- The message must be sent within 7 days of the comment was made on the post or reel\n \n- For Instagram Live, private replies can only be sent during the live broadcast. Once the broadcast ends, private replies cannot be sent\n \n- Follow-up messages can only be sent if the recipient responds, and must be sent within 24 hours of the response\n \n\n## Send a Private Reply\n\nTo send a private reply to a commenter on your app user's Instagram professional post, reel, or story, send a `POST` request to the `/messages` endpoint. The `recipient` parameter should contain the comment's ID and the `message` parameter should contain the text you wish to send.\n\n#### Sample request\n\n_Formatted for readability._\n\n```\ncurl -i -X POST \"https://<HOST_URL>/<API_VERSION>/<APP_USERS_IG_ID>/messages\"\n -H \"Content-Type: application/json\" \n -H \"Authorization: Bearer <ACCESS_TOKEN>\" \n -d '{\n \"recipient\":{ \n \"comment_id\": \"<COMMENT_ID>\" \n },\n \"message\": { \n \"text\": \"<COMMENT_TEXT>\" \n }\n }'\n\n ```\n\nOn success, your app receives a JSON response with the recipient's Instagram-scoped ID and the ID for the message.\n\n```\n{\n \"recipient_id\": \"526...\", // The Instagram-scoped ID \n \"message_id\": \"aWdfZ...\" // The ID for the private reply message\n}\n\n ```"
12241226
},
12251227
"response": [
12261228
{

0 commit comments

Comments
 (0)