Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have a facebook messenger bot send you a youtube video embedded in messenger

I was wondering if it is possible to have a messenger bot send you a youtube video link and generate a playable video inside messenger the same way you can if you paste a link inside the messenger. Right now my bot can send a message with a youtube link but it just sends it as text it doesn't generate a video recognizing the title, description etc. Any help would be appreciated.

like image 439
user3776662 Avatar asked Jul 03 '16 20:07

user3776662


People also ask

Can I add a bot in Messenger?

Customers simply click the “Message” button on your Facebook page (or website) and a Messenger session is launched automatically, allowing them to type a question and begin chatting with your bot. With the right chatbot in place, virtually any customer interaction can be initiated and automated using Messenger.

How do I get Messenger bot link?

You can find your bot link in the 'Insights' tab of the 'Home' section under the Facebook Channel (it's blue).


1 Answers

You can also send by OpenGraph. It will automatically display the video inside m.me chat window but in mobile iOS app, currently it redirects to youtube page:

curl -X POST -H "Content-Type: application/json" -d '{
  "recipient":{
    "id":"USER_ID"
  },
  "message":{
    "attachment":{
      "type":"template",
      "payload":{
        "template_type":"open_graph",
        "elements":[
           {
            "url":"https://www.youtube.com/watch?v=y9A1MEbgLyA"    
          }
        ]
      }
    }
  }
}' "https://graph.facebook.com/v2.6/me/messages?access_token=$TOKEN"
like image 56
mustafaturan Avatar answered Oct 11 '22 13:10

mustafaturan