5
Following is the payload for generic template. How to give attachment ID instead of image URL.

https://developers.facebook.com/docs/messenger-platform/send-messages/template/generic#payload SHOWS how to give generic template POST request and https://developers.facebook.com/docs/messenger-platform/send-messages#attachment_reuse shows how to use saved assets for sending. How to combine them both in the generic template

{  
"recipient":
{
    "id":"psid"  
},  
  "message":
{  
    "attachment":
    {  
      "type":"template",  
      "payload":
        {  
        "template_type":"generic",  
        "elements":
            [  
                {
                    "title":"Welcome to PeterHats",  
                    "image_url":"https://i.ytimg.com/vi/EGpy98wrHDo/hqdefault.jpg",  
                    "subtitle":"Actor \n Director",  
                    "default_action": 
                    {  
                        "type": "web_url",  
                        "url": "https://www.google.co.in",  
                        "messenger_extensions": true,  
                        "webview_height_ratio": "tall",  
                        "fallback_url": "https://www.facebook.com/"  
                    }
                }  
            ]  
        }  
    }  
}  

}

Matt Jerry
  • 501
  • 1
  • 3
  • 12
  • Not sure if that is actually possible in this place; you’re not dealing with an attachment here, but with a mere field `image_url` - and that likely is not going to accept anything else but a URL. – CBroe Nov 23 '17 at 14:42
  • ok thank you. Is it possible to have only the image and text below and not any url--- how do we construct the payload this way -- without default actions I get HTTP Bad request error – Matt Jerry Nov 23 '17 at 16:14

0 Answers0