Facebook Messenger Bot Tutorial - Send Private Message With PHP & WebHook

Поділитися
Вставка
  • Опубліковано 9 лют 2025

КОМЕНТАРІ • 124

  • @kamran2294
    @kamran2294 7 років тому +3

    Thanks man, very helpful

  • @magicalbhakuni
    @magicalbhakuni 7 років тому +1

    Great to see you back bro! :)
    I dig the new glasses.

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      magicalbhakuni Thank you so much. A lot more tutorials comming soon. :)

  • @federiconigro4160
    @federiconigro4160 7 років тому +1

    Hi man... I'm following your great tutorial from the beginning and my aim in these days is to create a chat bot starting from an index.php on a blank website (everything is configured well with facebook webhook and the website).
    Actually my index.php is equal to yours php file at minute 12:00 (when you write the response on the txt file) but when i try to post a comment to my page the txt file is not generated and nothing is written on it as well...
    What the problem could be?
    Maybe facebook v2.12? Maybe something that i didn't install on my server for php?...
    Thank you so much anyway!

  • @sonnguyentien5393
    @sonnguyentien5393 3 роки тому

    15:49 How can we get the access token instead of copying from graph api explorer?

  • @jeremymarshall5207
    @jeremymarshall5207 6 років тому

    If you were trying to only send a response on a specific post, wouldn't you need to check if the post_id == "Insert value"? Otherwise, would the user get the message regardless of what post they commented on? For your example you checked if the user commented red or blue on that post. But what if you had another post and the user commented on that one. Will they still get that red/blue message you setup?

  • @МихайлоКіряков
    @МихайлоКіряков 5 років тому

    Good video.
    I want to receive notifications of new subscribers for selected page.
    Which event to choose for webhook??

  • @balajipedapati4888
    @balajipedapati4888 6 років тому

    After completion of webhooks we are not getting feed link ,is there any reason why i am not able to get that link but we are getting leadgen link which is not usable to me so please suggest me what we have to do get that link feed.Initially means 1 month before i got feed link and retrieved comments also.

  • @billycheung3314
    @billycheung3314 6 років тому

    Thanks for the video.
    I have no idea why there is nothing written on text.txt when I comment on a post, however, it can log the data when I send message by massenger. I have tried to look for setting or testing method, but still cannot fix it. Could you help me?

  • @ajaydixit9910
    @ajaydixit9910 5 років тому +1

    Hi Can we create a similar bot that can be integrated in our private web page to communicate with facebook messenge? Please provide any refrence, it would be very helpfull to me.

    • @SenaidBacinovic
      @SenaidBacinovic  5 років тому +1

      Yes, you can create but it will take so much time to code it and get approved by Facebook. I would definitely suggest checking the services like ManyChat.

    • @ajaydixit9910
      @ajaydixit9910 5 років тому

      @@SenaidBacinovic Thanks for replying. I am looking forward for any refrence fo that I can code according.

  • @ionut1234567891011
    @ionut1234567891011 5 років тому +2

    i still working this tutorial? because i was trying and i get error on submit the POST.

  • @rajeshchowdhury2505
    @rajeshchowdhury2505 5 років тому

    is this project part of machine learning , AI ?

  • @ducminh7518
    @ducminh7518 6 місяців тому

    How to use it in 2024? I want build php page notification / sent messager to me when i save a record to database, as telegram notifi to channel? Thank

  • @maximillianiii4878
    @maximillianiii4878 4 роки тому

    Thanks so very helpful

  • @opionetics
    @opionetics 7 років тому

    I am finding that if I have a callback URL in a directory as you have such as xyz.com/mybot then the php://input is always empty, and I have to host my callback url in the main directory of the domain, example, xyz.com - have you come across this issue?

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      It can be some problem with your htaccess settings. Try to set URL that will go directly to the callback file.

  • @rabibgalib268
    @rabibgalib268 4 роки тому

    I didn’t get any notifications. Btw does this code pattern still work!! Cuz current graph version is 8.0
    Need your attention, Sir. 🙂

  • @dafiarecord72
    @dafiarecord72 5 років тому +1

    Boss, nice video never seeing before, thanks boss.

  • @ghanimki5763
    @ghanimki5763 4 роки тому

    Please could you check if it's still working or not, cuz I tried it yesterday and I get this error (Trying to get property 'object' of non-object) in the line of code (if ($data->object == "page")) and I check the value of $data it had no data Idk why data has no value.

    • @ghanimki5763
      @ghanimki5763 4 роки тому

      I used 000webhost.com as web host to my php file

  • @mohammedtasiuhamzabajoga4737
    @mohammedtasiuhamzabajoga4737 5 років тому

    Hello Senaid I'm Muhammad from Nigeria I'm really enjoying with your tutorials but I wanted to learn Python but you're don't have any video on that pls do some or full python course and I quest for your social media handles so that we can reach you privately. that Muhammad Nigeria!

  • @sivareddy6823
    @sivareddy6823 6 років тому

    awesome tutorial sir,thanq very much,after verify my callback url and verify token i didn't get feed and messanger,i got only one feild leadgen please help me

  • @thehunt975
    @thehunt975 6 років тому

    Hi there, I tried the same but its not showing subscribed app success over there giving a blank array.

  • @daytodatainc
    @daytodatainc 6 років тому +1

    What a great video! Thank you!

  • @solaymanmousa5083
    @solaymanmousa5083 2 роки тому

    this is still work on 2022 ?

  • @eyuksek2000
    @eyuksek2000 6 років тому +1

    Excellent! Thank you so much!

  • @esesoysho
    @esesoysho 6 років тому +1

    Thumb up because your tutorial was really useful. However I couldn't get it working, because (as far as I've seen) Facebook have restringed this functionality only for published apps, and the way to publish an app is quite stressful, I've to upload videos showing how I'm pretending to use my app and things like that. Regards

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому

      Thank you! Yes, after the latest updates in the Facebook API it's very challenging to get an app, and for most permissions, you will have to send videos to show how you're going to use that specific permission.

  • @androidlifebd242
    @androidlifebd242 6 років тому

    Boss, please up to date this video.
    now it's not working!
    or help me...
    I try to send message when a new comment added. But nothing happened!

  • @yourvocalcoach9971
    @yourvocalcoach9971 3 роки тому

    Can I add some update? There are so many apps today. As for me, I use a browser extension for automated messages on Facebook. It's called Cucomm, and I find it simple and convenient.

  • @kamran2294
    @kamran2294 7 років тому +1

    Hi bro, is the page access token going to get expired after a period of time? In case, if yes, how can we get a long life page access token? Thanks,

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому +1

      You can get more information about expiration time of your token on:
      developers.facebook.com/tools/debug/accesstoken/
      Also, you can read more on how to get long lived access token here:
      developers.facebook.com/docs/facebook-login/access-tokens/expiration-and-extension/
      Since I didn't talk about that in this video tutorial (I will have another one on that topic), it's better for you to read documentation and understand how it all works.

    • @kamran2294
      @kamran2294 7 років тому +1

      Thanks, I will and am looking forward to watch your tutorial on this topic.

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      Thank you!

  • @lives32
    @lives32 5 років тому

    my page can't use subscribed_apps my version is v.5.0 but when i subscribed_apps?subscribed_feed it result success:true but when i comment post file_get_contents('php://input') not send any thing :'( sorry for my eng is bad.

  • @Anonymous-yh4ho
    @Anonymous-yh4ho 6 років тому +1

    Great tutorial Senaid, thanks a lot!
    Do you have a tutorial on how to batch requests to the Facebook API as they are very restrictive with their rate-limiting?

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому +1

      Thank you! I don't have, but I might create one, great idea! :)

    • @Anonymous-yh4ho
      @Anonymous-yh4ho 6 років тому +1

      Coding Passive Income Please do! It would be very useful for many others :)

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому +1

      Already in my notes! :)

  • @sazzadhossainnirjhor5582
    @sazzadhossainnirjhor5582 6 років тому +1

    how to do the same thing in laravel ? any suggestion please..
    thanks in advance.

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому +1

      There is way too many things to change to explain in the comments and help you. I would definitely suggest that you find a tutorial that will show you how to do it.

    • @sazzadhossainnirjhor5582
      @sazzadhossainnirjhor5582 6 років тому +1

      thanks i just did that. :) .i got the notification response every time i comments . Thanks for awesome tutorial.

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому

      My pleasure, thank you!

  • @MuhammadAdnan-gx6rd
    @MuhammadAdnan-gx6rd 6 років тому +1

    Sir im your subscriber. ....
    I'm looking for how to show -new- label tag dynamically for fresh post like indeed.com has on fresh posts -new- text tag php ?

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому

      Thank you! This tutorial might help you: ua-cam.com/video/D3Ieioouzbo/v-deo.html

  • @marcelopereira9537
    @marcelopereira9537 6 років тому +1

    Thanks for the video, really nice.

  • @balajipedapati4888
    @balajipedapati4888 7 років тому +1

    Very Nice video but in this video you are explained regarding comments under that particular page so here we are getting the comments but we are expecting messages under that page that means if you are doing any messsages to that page from other facebook account is it way to write those messages into log????Is it avialable or not sir,If avaialable please let me know how is the way to get the messages instead of comments

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      Thank you. Yes, it's possible to read messages, but you will need to have a little bit different approach and also will need different permissions like read_page_mailboxes, pages_messaging, pages_messaging_subscriptions etc. (all depends on what exactly you want). However, check Facebook docs to see how to do it (for now).

    • @balajipedapati4888
      @balajipedapati4888 7 років тому

      how can i goto check Facebook docs can you please show me the path

    • @balajipedapati4888
      @balajipedapati4888 7 років тому

      and permissions read_page_mailboxes, pages_messaging, pages_messaging_subscriptions already given as mentioned in the video instead of this can i need to give any extra permisssions to fetch messages

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      Please check this docs: developers.facebook.com/docs/messenger-platform/webhook/

    • @biggboss5621
      @biggboss5621 7 років тому

      when i am going through our video i am getting comments in to my log file but i want messages for that one i tried through lot of videos but intially at 2 months it is working fine but suddenly from facebook site to our https site we are not getting any thing .Can you please out me to get messages back to my log file, for that one can you suggest any video like of this then we get more idea on this because i am gone through so many methods i am not getting message events..Sir Please can you do something for this?

  • @php6515
    @php6515 6 років тому

    Tutorial is helpful, i have my facebook page where we teach courses, many people inbox us for course inquiries i want to program a chat app where user ask some thing we reply with a drop down and ask there phone numbers or email and reply them course inquiries they ask for with its fee structure and class timimgs thankz for great tutorial,please suggest any thing for my question

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому

      Thank you. The easiest way for you to do it is to just use software like ManyChat, ChatFuel etc.

  • @amirrulilham
    @amirrulilham 6 років тому

    can u show how with v3.1 feed

  • @RatanThapa
    @RatanThapa 7 років тому

    Hi, why not make a video related to facebook chatbot with menu options something like IVR
    And Thanks a lot for the video... really helped me out
    Coding Passive Income Rocks !!

  • @balajipedapati4888
    @balajipedapati4888 7 років тому

    can we have the code like this in instagram because i want to work on instagram comments and messages

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      I never did it, so I don't know. I guess you should dive into the Instagram API documentation and find out.

  • @corneliusnw
    @corneliusnw 7 років тому +1

    Subscribed ;)
    Much thanks

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      Thank you so much! Appreciate the support. :)

  • @kingsleyjohnson7007
    @kingsleyjohnson7007 6 років тому

    It is not writing to the txt file here. Please help.

  • @samarkchaisangun
    @samarkchaisangun 6 років тому

    i can't see feed on webhook .this have only one leadgen.

  • @fawad0301
    @fawad0301 7 років тому +1

    Looking nice...

  • @rawsupershow123
    @rawsupershow123 5 років тому

    please update as of version 3.2 above 10:28 {
    "error": {
    "message": "(#100) The parameter subscribed_fields is required.",
    "type": "OAuthException",
    "code": 100,
    "fbtrace_id": "A4k9w_EAl5i5oEz99XGzF6a"
    }
    }

    • @rawsupershow123
      @rawsupershow123 5 років тому

      me/subscribed_apps?subscribed_fields=leadgen

  • @tudiyagames8548
    @tudiyagames8548 5 років тому

    Why i get this error message guys!?
    (#100) The parameter subscribed_fields is required.

  • @nicoladuru1591
    @nicoladuru1591 7 років тому

    how can i get a free domain and url to use as calll back

  • @toyandkids08
    @toyandkids08 6 років тому +1

    thanks bro

  • @Jonny-hq6eo
    @Jonny-hq6eo 6 років тому

    Some of the aliases you requested do not exist: private_replies

  • @hugowat8340
    @hugowat8340 7 років тому +1

    How to download Source Code? Thanks!

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      1. Find a link in the description of this video
      2. Once you open the website, on the right side there will be blue "Download Source Code" button
      3. Check your Facebook Messenger Inbox
      4. Enjoy it!

  • @sasikiran1915
    @sasikiran1915 6 років тому

    how to upload the php file ?

  • @kakolisaha981
    @kakolisaha981 6 років тому

    When I put my link callback URL then I get this error "The URL couldn't be validated. Response does not match challenge, expected value="2092440891", received="\u003C?php
    if (isset($_G..."

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому

      Can you show me the code?

    • @kakolisaha981
      @kakolisaha981 6 років тому

      Sorry for my delay.
      sure.but how?

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому +1

      Post here...

    • @kakolisaha981
      @kakolisaha981 6 років тому

      codingpassiveincome.com/facebook-messenger-bot-tutorial
      Hello, post here
      Kindly help me

    • @jaroslavnejedly5983
      @jaroslavnejedly5983 6 років тому

      @@kakolisaha981 I know what is your problem. PHP is not enabled on that server. It just receives a text, hence the "if (isset($_G..."

  • @thewalkerthapa5435
    @thewalkerthapa5435 7 років тому

    can't we make a facebook bot same as twitter bot?

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      THEWALKER ***** Can you explain a little bit more what do you think?

    • @thewalkerthapa5435
      @thewalkerthapa5435 7 років тому

      twitter bot that auto-Retweet some on facebook that auto comment

    • @SenaidBacinovic
      @SenaidBacinovic  7 років тому

      I have no idea what you are talking about?? :S

  • @وصفاتالأميرات
    @وصفاتالأميرات 6 років тому

    plz, how to fix read_page_mailboxes permission ??

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому

      Fix?

    • @وصفاتالأميرات
      @وصفاتالأميرات 6 років тому

      I applied all that you explained in the video, but the code does not work! I think the problem is permission read_page_mailboxes . how to get permission read_page_mailboxes ? thnx

    • @وصفاتالأميرات
      @وصفاتالأميرات 6 років тому

      or if you have an app to get valid access token with permission: read_page_mailboxes and manage_pages

    • @jaroslavnejedly5983
      @jaroslavnejedly5983 6 років тому

      @@وصفاتالأميرات it seems like in the bot app itself you forgot to check necessary permissions you need

  • @akashbiswas7445
    @akashbiswas7445 6 років тому

    Hey, I know this has been here for a long time, but i am getting this error.
    {
    "error": {
    "message": "(#100) The parameter subscribed_fields is required.",
    "type": "OAuthException",
    "code": 100,
    "fbtrace_id": "D32l0y+6EOJ"
    }
    }

  • @carpfishprodcuts
    @carpfishprodcuts 7 років тому +3

    please take music off i cannot understand anything form your videos . thanks

  • @MuhammadIrfan297
    @MuhammadIrfan297 6 років тому

    Great Informative Video bro

    • @jaroslavnejedly5983
      @jaroslavnejedly5983 6 років тому +1

      Look at this: github.com/kadnan/Facebook-Chat-Bot/blob/master/index.php
      Just strip down the message validation part and send a reply with what you need

    • @MuhammadIrfan297
      @MuhammadIrfan297 6 років тому

      Thanks bro

  • @maikdp
    @maikdp 7 років тому

    Not working, did not generate the text.txt in my server

  • @Jonny-hq6eo
    @Jonny-hq6eo 6 років тому

    no longer works: /

  • @balajipedapati4888
    @balajipedapati4888 6 років тому

    {
    "error": {
    "message": "(#200) Access to this data is temporarily disabled for non-active apps or apps that have not recently accessed this data due to changes we are making to the Facebook Platform. developers.facebook.com/status/issues/205942813488872/",
    "type": "OAuthException",
    "code": 200,
    "fbtrace_id": "E3/iKpzpFE1
    "
    }
    }
    that is the erro we are getting when we goto forward cases please give me the suffcient solution for this

  • @manojrupasinghe9412
    @manojrupasinghe9412 7 років тому +1

    Supperp bro

  • @marketingarabe
    @marketingarabe 6 років тому

    not working

  • @SynthToshi
    @SynthToshi 6 років тому +1

    Nice videos! how hard would it be to create a bot to message everyone on your friends list? #cryptodaddys

    • @SenaidBacinovic
      @SenaidBacinovic  6 років тому

      Thank you. It's impossible, they need to subscribe to your bot first.

    • @SynthToshi
      @SynthToshi 5 років тому

      @@SenaidBacinovic i dont have a bot tho what so i need to create a bot for my profile and have my friends sub to the bot? I dont understand.