Skip to main content

Facebook Message Types

There are various types of raw (unstructured) content that can be sent to your users.

Text

Text
Text
{
type: "TEXT",
text: "Hello World!"
}
PropertyDescriptionRequired
typeTEXTY
textString; Limited to 2,000 charactersY

Image

Image
Image
{
type: "IMAGE",
url: "http://image.png",
attachment_id: "SomeStringID"
}
PropertyDescriptionRequired
typeIMAGEY
urlURL of the image fileY
attachment_idString; ID of your uploaded imageN
note
  • Image must be a valid image file format, including .jpg, .jpeg, .png, .gif, .tiff and .bmp
  • Maximum file size is 2MB
  • You may send out Quick Reply buttons together with an image

Audio

Audio
Audio
{
type: "AUDIO",
url: "http://audio.mp3",
attachment_id: "SomeStringID",
}
PropertyDescriptionRequired
typeAUDIOY
urlURL of the audio fileY
attachment_idString; ID of your uploaded audioN
note
  • Audio must be a valid audio file format, including .aac, .flac, .m4a, .m4p, .mp3, .wav and .wma
  • You may send out Quick Reply buttons together with an audio message

Video

Video
Video
{
type: "VIDEO",
url: "http://video.mp4",
attachment_id: "SomeStringID"
}
PropertyDescriptionRequired
typeVIDEOY
urlURL of the video fileY
attachment_idString; ID of your uploaded videoN
note
  • Video must be a valid video file format, including .mkv, .gif, .avi, .wmv, .rmvb, .mp4, .m4v, .mpg, .mpeg and .3gp
  • Maximum file size is 25MB
  • You may send out Quick Reply buttons together with a video

File

File
File
{
type: "FILE",
url: "http://file.pdf",
attachment_id: "SomeStringID",
}
PropertyDescriptionRequired
typeFILEY
urlURL of the file attachmentY
attachment_idString; ID of your uploaded fileN
note
  • File must be a valid file format, including .pdf
  • Maximum file size is 25MB
  • You may send out Quick Reply buttons together with a file

Carousel is a horizontal scrollable row of items, each composed of an image attachment, short description and buttons to request input from users.

Carousel
Carousel

{
type: "CAROUSEL",
carousel: [{
title: "Classic T-Shirt",
subtitle: "Medium Grey\n$29.99",
image_url: "http://img.url",
default_action: {
type: "web_url",
url: "https://zuckstees.com"
},
buttons: [{
type: "web_url",
url: "https://sanuker.com",
title: "View Details"
}, {
type: "postback",
title: "Shop Now",
payload: "A_LONG_PAYLOAD_HERE"
}, {
type: "phone_number",
title: "some title 3",
payload: "PHONE_NUMBER"
}]
}],
image_aspect_ratio: "square"
}
Response Object
PropertyDescriptionRequired
typeCAROUSELY
carouselArray of carousel items; Maximum of 10 elementsY
image_aspect_ratioSet "horizontal" (1.91:1) or "square" (1:1); Defaults to "horizontal"N
carousel Object
PropertyDescriptionRequired
titleString; Limited to 80 charactersY
subtitleString; Limited to 80 charactersN
image_urlURL of the image displayedN
default_actionDefault website URL when users click on the imageN
buttonsArray of buttons; Maximum of 3 buttons that appear as call-to-actionN
note
  • You may send out Quick Reply buttons together with a carousel
  • You may not necessarily include buttons for a carousel if no call-to-action is intended

Buttons

Button
Button
{
type: "BUTTON",
text: "What can I do to help?",
buttons: [{
type: "web_url",
url: "https://sanuker.com",
title: "Get Order Status"
}, {
type: "phone_number",
title: "Call Me",
payload: "PHONE_NUMBER"
}, {
type: "postback",
title: "some title 2",
payload: "A_LONG_PAYLOAD_HERE"
}]
}
PropertyDescriptionRequired
typeBUTTONY
textString; Limited to 640 charactersY
buttonsArray of buttons; Maximum of 3 buttons that appear as call-to-actionY

URL Button

URL Buttons
URL Buttons
Open Webview
Open Webview

The URL Button can be used to open a web page in the in-app browser. This button can be used with the Buttons Template, Carousel and List. A web view can be rendered in three different ways: compact, tall or full.

{
type: "web_url",
title: "some title",
url: "https://sanuker.com",
webview_height_ratio: "tall",
messenger_extensions: true,
fallback_url: "https://sanuker.com",
webview_share_button: "hide",
urlTracking: false,
}
PropertyDescriptionRequired
typeweb_urlY
titleString; Limited to 20 charactersY
urlURL of the destination; Must be HTTPS if messenger_extensions is "true"Y
webview_height_ratioHeight of the webview window; Set "compact", "tall" or "full"; Defaults to "full"N
fallback_urlURL to use on clients that don't support Messenger Extensions; Set only if messenger_extensions is "true"; Defaults to url if not specifiedN
webview_share_buttonSet "hide" or unsetN
urlTrackingDefaults to "true"N

The Analytics for URL can be enabled while creating the URL Button in response.

Once a user clicks the URL button, it will be tracked and logged to the analytics dashboard.


Postback Button

Postback Button
Postback Button

The Postback Button helps invoke an action in your chatbot. You can set a payload to the button.

{
type: "postback",
title: "some title",
payload: "some payload",
}
PropertyDescriptionRequired
typepostbackY
titleString; Limited to 20 charactersY
payloadCustom defined payload triggers; Limited to 1,000 charactersY

Call Button

Call Button
Call Button

The Call Button can be used to initiate a phone call directly.

{
type: "phone_number",
title: "Call us",
payload: "+85281930208"
}
PropertyDescriptionRequired
typephone_numberY
titleString; Limited to 20 charactersY
payloadFormat must have "+" prefix followed by the country code, area code and local number without any spaceY

Log in Button

Log In Button
Log In Button

The Log In Button can be used to link a third-party user account to Facebook Messenger.

    {
"type": "account_link",
"url": "https://stella.sanuker.com"
}
PropertyDescriptionRequired
typeaccount_linkY
urlURL of the destination; Must be HTTPSY

Quick Reply

Quick Reply provide a different way to present buttons in a message. It contains text and an optional image.

The only difference between Quick Reply and Button is that Quick Reply only appears once and will be dismissed once it is clicked, while Button remains on the message even it is clicked. This prevents the scenario where users could tap on the old Quick Reply buttons attached to previous messages in the conversation.

Facebook quick replies
Facebook quick replies
{
type: "QUICK_REPLIES",
text: "some text",
quickReplies: [{
content_type: "text",
title: "Red",
payload: "PAYLOAD_STRING",
image_url: "http://red.img.url"
}, {
content_type: "text",
title: "Green",
payload: "PAYLOAD_STRING",
image_url: "http://green.img.url"
}, {
content_type: "text"
}]
}
Response Object
PropertyDescriptionRequired
typeQUICK_REPLIESY
textString; Limited to 2,000 charactersY
quickRepliesArray of quick reply buttons; Maximum of 13 buttonsY
quickReplies Object
PropertyDescriptionRequired
content_typeSet "text", "user_phone_number" or "user_email"Y
titleString; caption of button; Limited to 20 charactersOnly if content_type is "text"
image_urlURL of image for text quick replyN
payloadCustom defined payload trigger; Limited to 1,000 charactersOnly if content_type is "text"
s NOTE
  • Image for image_url should be at least 24x24 and will be cropped and resized.
  • If user doesn't have phone number or email in the profile, the "user_phone_number" and "user_email" quick reply button won't be displayed.

Media

Media is similar to a carousel without title and subtitle but it can also display video.

Facebook media
Facebook media
{
type: "MEDIA",
media_type: "image",
attachment_id: "attachmentId",
buttons: [{
type: "postback",
title: "Show Me More!",
payload: "A_LONG_PAYLOAD_HERE"
}]
}
PropertyDescriptionRequired
typeMEDIAY
media_typeSet "image" or "video"Y
attachment_idString; ID of your uploaded media fileY
buttonsArray of buttons; Maximum of 3 buttons that appear as call-to-actionN
note
  • You may send out Quick Reply buttons together with a media template

Public Reply

Public Reply refers to the comment reply to users' comments on Facebook post.

Facebook public reply
Facebook public reply
{
type: "PUBLIC_REPLY",
text: "some text",
attachment_id: "attachmentId",
attachment_url: "https://img.url"
}
PropertyDescriptionRequired
typePUBLIC_REPLYY
textString; Limited to 5,000 charactersEither text, attachment_id or attachment_url must be set
attachment_idString; ID of your uploaded media fileEither text, attachment_id or attachment_url must be set
attachment_urlURL of the media file you want to postEither text, attachment_id or attachment_url must be set

Messaging Types

Meta supports 3 messaging types to ensure that the message being sent complies with messaging policies and the recipient's preferences.

Please refer to here for more detail about the messaging types.

Response

{
"type": "TEXT",
"messagingMeta": {
"messaging_type": "RESPONSE"
},
"text": "Test Text"
}

Updates

{
"type": "TEXT",
"messagingMeta": {
"messaging_type": "UPDATE"
},
"text": "Test Text"
}

Message Tag

{
"type": "TEXT",
"messagingMeta": {
"tag": "ACCOUNT_UPDATE",
"messaging_type": "MESSAGE_TAG"
},
"text": "Test Text"
}
PropertyDescription
tagEither one of these: ACCOUNT_UPDATE, CONFIRMED_EVENT_UPDATE, CUSTOMER_FEEDBACK or HUMAN_AGENT