Skip to content

veyselpehlivan/RestService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quiz Program

This project is a chatbot that makes quiz. This program is worked on Facebook messenger by using Java, Spring boot and messenger4j.

Getting Started

Prerequisites

  • Git
  • JDK 8 or later
  • Maven 3.0 or later
  • Mysql

How to Clone?

Some basic Git commands are:

git clone https://github.com/veyselpehlivan/RestService.git
cd RestService

Configuration

messenger4j.appSecret = ${MESSENGER_APP_SECRET}
messenger4j.verifyToken = ${MESSENGER_VERIFY_TOKEN}
messenger4j.pageAccessToken = ${MESSENGER_PAGE_ACCESS_TOKEN}

The configuration is located in src/resources/application.properties

Running this Program on Your Local Host

Prequisites

  • Git
  • Ngrok
  • Mysql

Steps that You should Follow

  1. Clone the project 2.Create a Facebook page

Create and Configure Facebook App

  1. open https://developers.facebook.com/apps
  2. click the 'Add a New App' button
  3. enter the Display Name, e.g. chatbot
  4. select the Category: 'Apps for Messenger'
  5. click the 'Create App ID' button
  6. Section 'Token Generation': Select your created FB Page, e.g. Messenger4j Demo
  7. copy the 'Page Access Token' to the clipboard
  8. paste this 'Page Access Token' to the ${MESSENGER_PAGE_ACCESS_TOKEN}
  9. navigate to 'Dashboard'
  10. copy the 'App Secret' to the clipboard
  11. paste this 'App Secret' to the ${MESSENGER_APP_SECRET}
  12. use a randomly generated string as 'Verify Token', e.g. retgdkfjsjklsklj34qdfs
  13. paste this 'Verify Token' to the ${MESSENGER_VERIFY_TOKEN}
  14. run the code
  15. open the ngrok
  16. create a callback url by using ngrok
  17. navigate back to 'Messenger'
  18. Section 'Webhooks': Click the 'Setup Webhooks' button
  19. enter the Callback URL that is generated by ngrok enter the generated Verify Token, e.g. retgdkfjsjklsklj34qdfs
  20. select the following Subscription Fields: messages, messaging_postbacks, messaging_optins, message_deliveries, message_reads, messaging_account_linking, message_echoes
  21. click the 'Verify and Save' button
  22. Section 'Webhooks': Select your created FB Page to subscribe your webhook to the page events
  23. click the 'Subscribe' button

Test your Chatbot

  1. Send 'Start' message

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published