Closed johntiror closed 5 years ago
Is this possible? It looks like it’s just two separate messages.
there are not, since otherwise it'd require a title. here an example payload:
{
"recipient": {
"id": recipient_id
},
"message": {
"attachment":{
"type":"image",
"payload":{
"url": image_url
}
},
"quick_replies": [
{
"content_type":"text",
"title": "Next Image",
"payload": "YOUR_DEFINED_PAYLOAD_FOR_NEXT_IMAGE"
}
]
}
}
I think this doesn't depends on BotMan but facebook since facebook is the one establishing the protocol about what a generic template can integrate.
Yes I agree. If anyone finds out how to hack
it, please write it here.
This worked for me
{
"facebook": {
"attachment":{
"type":"template",
"payload":{
"template_type":"generic",
"elements":[
{
"title":"Welcome!",
"image_url":"https://petersfancybrownhats.com/company_image.png",
"subtitle":"We have the right hat for everyone.",
"default_action": {
"type": "web_url",
"url": "https://petersfancybrownhats.com/view?item=103",
"webview_height_ratio": "tall"
},
"buttons":[
{
"type":"web_url",
"url":"https://petersfancybrownhats.com",
"title":"View Website"
},{
"type":"postback",
"title":"Start Chatting",
"payload":"DEVELOPER_DEFINED_PAYLOAD"
}
]
}
]
}
},
"quick_replies":[
{
"content_type":"text",
"title":"Search",
"payload":"<POSTBACK_PAYLOAD>",
"image_url":"http://example.com/img/red.png"
},
{
"content_type":"location"
}
]
}
}
Currently it's not possible to add quick_replies to GenericTemplate. We need to add a way to achieve this:![image uploaded from ios](https://user-images.githubusercontent.com/3677019/32691464-3c81cfaa-c708-11e7-935d-601916fb7f46.png)