![]() ![]() $input = json_decode(file_get_contents(‘php://input’), true) $sender = $input $message = $input įirst line using to get message from Facebook and then convert the JSON into PHP Associative Array. In next step we will convert this message structure by decoding JSON into an array and fetch sender Id and message. ![]() Now you will know the power of nGrok Web Interface, here we are receiving message from Bot in a JSON format. Visit and you will see something like this(as of April, 2016) For sake of this tutorial I am assuming that you never created a page before. You may use existing Fan page for this purpose. ![]() Do note that it is not necessary to create a separate page only for Bot purpose. I am going to create Bot’s Page first, this page will actually be the entry point for communication for the bot to interact with your page fans/users. For our bot, we are just fetching latest(NOW) time. I am going to create a Time bot which will tell you current time Time API that provides different options to retrieve time. Facebook puts no limitation in this regard. and they will get messages as if some human representatives is responding to them. What could they do that they integrate or host their bot on their official page, a fan can just click on Message button and send messages to order a Pizza, get new deals etc. ![]() For example, suppose Pizza Hut introduce a bot for order related operations. In order to create an Fb bot you will need two things to host your bot: A Facebook Page which will be like Home of Bot, people will visit the page, click on Message option to Interact with your bot. Ok! so without wasting further time, let’s build our first Bot! Time Bot I headed over to documentation which provided good information for starters. I started to find some SDK in this regard released by Facebook but none was present. When I first heard of it, my very first thought was to a bot in PHP. To recap, Featured CBM: The Most Complete Report on what Facebook Messenger has Launched on F8 What Is a Chatbot?Ī computer program designed to simulate conversation with human users, especially over the internet. Facebook recently announced a Bot platform for its Messenger which provides businesses and individuals another way to communicate with people. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |