I am browsing the Facebook Messenger platform and cannot find information on a specific issue. I want the bot user to share a structured message with his contacts, which would lead the contact to the bot chat, taking care of the context.
Structured message exchange works well:
- bot response with a message containing a template with a share button
- Click the button to open your own sharing menu.
- user selects contacts for messaging using
- message sent
- each contact receives a message as original
Everything described in the document: https://developers.facebook.com/docs/messenger-platform/send-api-reference/share-button
The next part of the puzzle is the “Postback Button”, which can be added to the structured message template in the same way as the “Share Button” (described here https://developers.facebook.com/docs/messenger-platform/send-api -reference / postback-button ). Click the “Postback Button” by sending the metadata to the webhook. All is well with this ...
, , . , . , "" " ", "Like" . , . , "Like" ( ), , . " " - . - , .
, , "Like" . - ( ), . , "URL-" ( Messenger).
- ?
, :
var messageData = {
recipient: {
id: recipientId
},
message: {
attachment: {
type: "template",
payload: {
template_type: "generic",
elements: [{
title: "Shake it off",
subtitle: "Lorem ipsum....",
buttons: [{
type: "web_url",
title: "Watch video",
url: "http...",
}, {
type: "postback",
title: "Like",
payload: "id=xyz",
}, {
type: "element_share",
}]
}]
}
}
}
};