Rozdíly
Zde můžete vidět rozdíly mezi vybranou verzí a aktuální verzí dané stránky.
Následující verze | Předchozí verze | ||
skoda-ep:modules:messenger_bot_module:setup [06.02.2018 14:40] jan.lorenc vytvořeno |
skoda-ep:modules:messenger_bot_module:setup [29.03.2018 06:16] (aktuální) jan.lorenc |
||
---|---|---|---|
Řádek 1: | Řádek 1: | ||
- | x | + | ====== SETUP ====== |
+ | |||
+ | To setup bot properly you need to follow every chapter in this article, best in same order. | ||
+ | |||
+ | ===== Setup Facebook Page ===== | ||
+ | |||
+ | Fb messenger bot needs facebook page on behalf which will be communicating. | ||
+ | |||
+ | So its important to create new Facebook page. | ||
+ | |||
+ | After logging into facebook, head over to: | ||
+ | |||
+ | https://www.facebook.com/pages/create/ | ||
+ | |||
+ | After creating page, u can get Page ID from URL, for example: | ||
+ | |||
+ | https://www.facebook.com/Test-1796766873669723/ => 1796766873669723 (will need this later on) | ||
+ | |||
+ | Alternative way to obtain Page ID is described here | ||
+ | https://www.facebook.com/help/community/question/?id=378910098941520 | ||
+ | |||
+ | ===== Setup facebook App ===== | ||
+ | |||
+ | After page creation it's essential to create facebook App and connect it to Page. | ||
+ | |||
+ | You need to login again as a facebook developer and Create new App | ||
+ | |||
+ | https://developers.facebook.com/apps | ||
+ | |||
+ | Afted App creation head to Messenger section | ||
+ | https://developers.facebook.com/apps/xxx/messenger/settings/ | ||
+ | |||
+ | {{:skoda-ep:modules:fb-app-1.png?200|}} | ||
+ | |||
+ | Select Page from dropdown and generate Token (will be used later) | ||
+ | |||
+ | {{:skoda-ep:modules:fb-app-2.png?200|}} | ||
+ | |||
+ | Select a page to subscribe | ||
+ | |||
+ | {{:skoda-ep:modules:fb-bot-8.png?600|}} | ||
+ | |||
+ | Next step is to setup webhooks | ||
+ | |||
+ | {{:skoda-ep:modules:fb-app-3.png?400|}} | ||
+ | |||
+ | * Callback URL => wordpress endpoint => https://skoda-wlc.ys-dev.cz/wide/wp-json/fb-msg/webhook | ||
+ | * Verify Token => write random string (will be used later) | ||
+ | * Subscriptions Fields => check "messages", "messaging_optins", "messaging_postbacks" and "messaging_referrals" | ||
+ | |||
+ | Now it's time to setup Wordpress facebook messenger by section "Setup credentials in wordpress". After All is set up, return here and click Verify and Save to finalize setup. | ||
+ | |||
+ | At first fb messenger bot will be in development mode - only administrator of facebook App will see plugin and be able to optin for notifications - for testing purposes. | ||
+ | After development stage is over its essential to submit App for revision to Facebook to enable it for public use. | ||
+ | |||
+ | {{:skoda-ep:modules:fb-app-4.png?600|}} | ||
+ | |||
+ | ===== Setup credentials in wordpress ===== | ||
+ | |||
+ | First step is to enable "YS facebook messenger API" plugin in Plugins => Installed Plugins. | ||
+ | |||
+ | Then head over to SKODA options => `FB msg - general` tab. You should have all fields gathered from previous sections. | ||
+ | |||
+ | GENERAL OPTIONS: | ||
+ | * App ID => ID of created app in facebook developers console | ||
+ | * App Secret => Obtained from App Settings -> Basic in facebook developers console | ||
+ | * Page ID => ID of facebook page on which behalf bot will communicate. Obtaining is described in first section of this manual | ||
+ | * Verify Token => string set up to validate wordpress API in facebook developers console | ||
+ | * Page Access Token => token generated in facebook developers console | ||
+ | * Send from all categories => check to send notifications from all published posts. Otherwise only notifications from particular category new posts will be sent | ||
+ | |||
+ |