Share Button

The Share Button enables people to share message bubbles with their contacts using a native share dialog in Messenger.

Messages that are shared display the page name and profile pic, indicating the origin of the message. This attribution can be tapped, enabling friends to start their own conversations from shared content.

Notes:

  • Only individual message bubbles can be shared.
  • If your message bubble has URL Button using Messenger Extensions (without fallback URL), Postback, Buy Button, the behavior of those buttons will change such that tapping on them will start a new thread with your bot. For a URL Button using Messenger Extensions, fallback URL will be opened if specified. Share, URL (without Messenger Extensions) and Phone number buttons will behave normally.

Implementation

The Share Button only works with the Generic Template. In the Send API, set the button type to element_share. This will generate a Share Button with title set as "Share".

  ...
  
    "buttons":[
      {
        "type":"element_share"
      }              
    ]
  
  ...

buttons Fields

Property Name Description Type Required

type

Type of button. Must be element_share.

String

Y

Example

curl -X POST -H "Content-Type: application/json" -d '{
  "recipient":{
    "id":"USER_ID"
  },
  "message":{
    "attachment":{
      "type":"template",
      "payload":{
        "template_type":"generic",
        "elements":[
          {
            "title":"Breaking News: Record Thunderstorms",
            "subtitle":"The local area is due for record thunderstorms over the weekend.",
            "image_url":"https://thechangreport.com/img/lightning.png",
            "buttons":[
              {
                "type":"element_share"
              }              
            ]
          }
        ]
      }
    }
  }
}' "https://graph.facebook.com/me/messages?access_token=PAGE_ACCESS_TOKEN"