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显示如何提供通用模板 POST 请求和https://developers.facebook.com/docs/messenger-platform/ send-messages#attachment_reuse展示了如何使用保存的资产进行发送。如何在通用模板中将它们结合起来
{
"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/"
}
}
]
}
}
}
}