Messenger Platform

 
 
 

Message Templates

Message templates offer a way for you to offer a richer in-conversation experience than standard text messages by integrating buttons, images, lists, and more alongside text a single message. Templates can be use for many purposes, such as displaying product information, asking the message recipient to choose from a pre-determined set of options, and showing search results.

Contents

Available Templates

The following templates are available for sending structured messages:

Sending a Message Template

Like simple text messages, message templates are sent by sending a POST request to the /me/messages endpoint of the Graph API along with a page access token:

https://graph.facebook.com/v2.6/me/messages?access_token=<PAGE_ACCESS_TOKEN>

The body of the request follows a standard format for all template types, with the message.attachment.payload property containing the type and content details that are specific to each template type:

{
  "recipient":{
    "id":"<PSID>"
  },
  "message":{
    "attachment":{
      "type":"template",
      "payload":{
        "template_type":"<TEMPLATE_TYPE>",
        ...
      }
    }
  }
}

Using Buttons

Most message templates allow you to incorporate one or more buttons as part of the template. These buttons allow you to offer the message recipient actions they can take in response to the template.

The type of buttons that can be used vary by template. See the specific template reference documentation for more information.

For more on button types available in the Messenger Platform, see Buttons.