hunkim / Wit-Facebook

Wit-Faebook Messenger Example
158 stars 259 forks source link

Quick instruction #1

Closed hunkim closed 8 years ago

hunkim commented 8 years ago

image

Add a new app: image

Select WWW platform: image

Name it and click "Create New Facebook App ID": image

Add email and select category: image

Add website (any website is OK):

image

From https://developers.facebook.com/apps/, select the created app:

image

Select Messenger and get statred: image

Select the page you have created and get the Page Acess Token: image

Click Deploy Button in our gitrepos README.md

image

Set the WIT_TOKEN, FB_PAGE_TOKEN, and FB_VERIFY_TOKEN. image

Make sure it's sucess and view the app: image

You may see something like this from https://{yourspecificedname}.herokuapp.com/: ""Only those who will risk going too far can possibly find out how far one can go." - T.S. Eliot"

Final step is put this server name in the facebok app page. From https://developers.facebook.com/apps/, select your app and messenger. You will see Webhooks:

image

Select "Setup Webhooks", and you will see callback URL and verify token. For the callback URL put your herokuapp URL + "/webhook". For example, my callback URL is https://fbwitbot.herokuapp.com/webhook.

Type the Verify Token that you set. If you haven't set, the default value is "just_do_it".

Click all items in the Subscription Fields.

image

Then, you will see green complete! image

You may need to select the page one more time:

curl -X POST "https://graph.facebook.com/v2.6/me/subscribed_apps?access_token="

You may see: {"success":true}

Finally, go to the Facebook page, you created/selected and send a message there: image

image