How to give attachment ID in generic template image URL

561 Views Asked by At
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/"  
                    }
                }  
            ]  
        }  
    }  
}  

}

0

There are 0 best solutions below