+ "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&ccb=1-7&_nc_sid=e280be&_nc_ohc=o-6sEb0pAD4Q7kNvwH6dwh4&_nc_oc=AdlUD-7_QFWK0hie_tK-nvBkzdHs4mTnKhI8DKkCOHGZGoZHCd_DCJSSa-zZlM1e3hQjAz2SbC3e0HSJeCiDkuH4&_nc_zt=14&_nc_ht=scontent-lax3-1.xx&_nc_gid=cuNeXMnWbL5xXCgRGWgP3A&oh=00_AfYWyOThR6r0MN4jWRMPWh_7Rs6pXa4q9qUGxnpFpCQiEQ&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}' \"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 ```"
0 commit comments