How to send Templates on Facebook Messenger

Updated 1 month ago by Matthew Clementson

How to send templates

Have a look at Facebook's documentation for the supported templates

Button Templates,
Generic Templates,
List Templates

The following button types can be used in any of the templates

  • web_url
  • phone_number
  • element_share
  • postback

Note that our facebook node is what Facebook calls the message node i.e. if you are following a Facebook example then copy the message node in its entirety and rename it to facebook as shown in the example below.

Example payload for a response using the generic template

{
             "text":"Random picture from Giphy",
             "facebook":{
                "attachment":{
                   "type":"template",
                   "payload":{
                      "elements":[
                         {
                            "image_url":"<img src="<img src=" <img="">">">",
                            "subtitle":"Probably of kittens anyway.",
                            "title":"Random picture from Giphy",
                            "default_action":{
                               "title":"View",
                               "type":"web_url",
                               "url":"http://media0.giphy.com/media/xTk9ZDnmIpj3DecfIY/giphy.gif"
                            },
                            "buttons":[
                               {
                                  "title":"View",
                                  "type":"web_url",
                                  "url":"http://media0.giphy.com/media/xTk9ZDnmIpj3DecfIY/giphy.gif"
                               }
                            ]
                         }
                      ],
                      "template_type":"generic"
                   }
                }
             }
          }

How did we do?