Skip to content

simasj/app-chat-bot-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paysera Chat Bot Workshop

Requirements

  • PHP >=5.5
  • composer
  • ngrok
  • Facebook Account

Setup instructions

PHP server

For simplicity of this task, we will use built-in PHP server.

  • install dependencies with composer install
  • from project's directory run in console php -S localhost:9999.
  • check local PHP server is running - in browser go to http://localhost:9999/ - you should see a blank page.

ngrok

Ngrok is local proxy allowing your PC to be accessible from Internet.

Facebook App Setup

  1. Go to Messenger API platform and click Try It now

  2. Launch Test Drive:

  3. Fill required steps:

    1. Check the checkbox
    2. Skip Node.JS installation
    3. Enter chat bot name - must start with capital letter
    4. Skip package download - we do not need it
    5. Fill url you got from ngrok setup - do not press Next, you will get an error
    6. In another browser tab go to Facebook Apps
    7. Click on App with your chat bot name (You filled it in Step 3)
    8. Save the App ID and App Secret - in configuration file
    9. Go to Messenger in Products sidebar
    10. Under Token Generation select Page with same name as your chat bot name, save the Page Access Token in configuration
    11. Go to previous browser tab and click Next in Step 5
  4. If everything was according to plan, you can open Messenger, search for chat bot and he should reply to you.

Changed ngrok hostname?

In case you restarted ngrok, you will receive a new public hostname, you need to change it in App Webhooks

About

A simple chat bot Workshop

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%