
messages event is sent to your webhook that contains the button title and an optional payload.quick_replies array to a text message, and include objects that define up to 13 quick reply buttons.curl -X POST -H "Content-Type: application/json" -d '{
"recipient":{
"id":"{PSID}"
},
"messaging_type": "RESPONSE",
"message":{
"text": "Pick a color:",
"quick_replies":[
{
"content_type":"text",
"title":"Red",
"payload":"{POSTBACK_PAYLOAD}",
"image_url":"http://example.com/img/red.png"
},{
"content_type":"text",
"title":"Green",
"payload":"{POSTBACK_PAYLOAD}",
"image_url":"http://example.com/img/green.png"
}
]
}
}' "https://graph.facebook.com/v25.0/me/messages?access_token={PAGE_ACCESS_TOKEN}"
| Property | Type | Description |
|---|---|---|
text | String | Non-empty message text to send with the quick replies. text or attachment must be set. |
attachment | Object | An attachment to send with the quick replies. text or attachment must be set. |
quick_replies | Array | An array of quick_reply objects that describe the quick reply buttons to send. A maximum of 13 quick replies are supported. |
quick_reply object properties| Property | Type | Description |
|---|---|---|
content_type | String | Must be one of: text (sends a text button), user_phone_number (sends a button allowing recipient to send the phone number associated with their account), user_email (sends a button allowing recipient to send the email associated with their account). |
title | String | Required if content_type is text. The text to display on the quick reply button. 20 character limit. |
payload | String or Number | Required if content_type is text. Custom data sent back to you via the messaging_postbacks webhook event. 1000 character limit. May be set to an empty string if image_url is set. |
image_url | String | Optional. URL of image to display on the quick reply button for text quick replies. Image should be a minimum of 24px x 24px. Larger images are automatically cropped and resized. Required if title is an empty string. |
content_type for a quick reply is specified as text, you must specify a non-empty title.{ "content_type": "text", "title": "<BUTTON_TEXT>", "image_url": "http://example.com/img/red.png", "payload": "<DEVELOPER_DEFINED_PAYLOAD>" }
text property of the event corresponds to the title of the quick reply. The message object also contains a field named quick_reply containing the payload data on the quick reply.{
"object": "page",
"entry": [
{
"id": "<PAGE_ID>",
"time": 1502905976963,
"messaging": [
{
"sender": {
"id": "1254459154682919"
},
"recipient": {
"id": "682498171943165"
},
"timestamp": 1502905976377,
"message": {
"quick_reply": {
"payload": "DEVELOPER_DEFINED_PAYLOAD_FOR_PICKING_GREEN"
},
"mid": "m_AG5Hz2Uq7tuwNEhXfYYKj8mJEM_QPpz5jdCK48PnKAjSdjfipqxqMvK8ma6AC8fplwlqLP_5cgXIbu7I3rBN0P",
"text": "Green"
}
}
]
}
]
}
{ "content_type": "user_phone_number" }
payload attribute of the messages webhook event.{ "object": "page", "entry": [ { "id": "<PAGE_ID>", "time": 1502905976963, "messaging": [ { "sender": { "id": "<SENDER_PSID>" }, "recipient": { "id": "<PAGE_ID>" }, "timestamp": 1502905976377, "message": { "quick_reply": { "payload": "<PHONE_NUMBER>" }, "mid": "<MESSAGE_ID>", "text": "<PHONE_NUMBER>" } } ] } ] }
{ "content_type": "user_email" }
payload attribute of the messages webhook event.{ "object": "page", "entry": [ { "id": "<PAGE_ID>", "time": 1502905976963, "messaging": [ { "sender": { "id": "<SENDER_PSID>" }, "recipient": { "id": "<PAGE_ID>" }, "timestamp": 1502905976377, "message": { "quick_reply": { "payload": "<EMAIL_ADDRESS>" }, "mid": "<MESSAGE_ID>", "text": "<EMAIL_ADDRESS>" } } ] } ] }