Facebook Channel Setup

Facebook Channel Setup

Prerequisites

In order to set up a bot including a facebook channel you need to have set up the following prerequisites:

  1. Go through the bot creation process but stop before the last step "Creating you first ChatBot"

Creating the bot including the facebook channel

  1. Log in with your facebook account and go to your already created app

  2. Click on Add Product in the menu and select Messenger

  3. Generate the page access token

  4. Make a POST to /botstore/bots with a json like this:

    { "packages": [ "eddi://ai.labs.package/packagestore/packages/?version=1" ], "channels": [ { "type": "eddi://ai.labs.channel.facebook", "config": { "appSecret": "", "verificationToken": "", "pageAccessToken": "" } } ] }

  5. Deploy your bot as described in the "Creating you first ChatBot" page!

After deployment your webhook URL will look like this:

https://<hostname>/channels/facebook/<BOT_ID>?version=1

VERY IMPORTANT! The url needs to be https and the certificate needs to be an actual certificate of a valid certification agency. For free certificates have a look here: https://letsencrypt.org

  1. Click on messenger in the menu and open the webhook setup.

  2. Enter your bot url and the verification token that you entered, when creating the bot and add messages as a subscription

  3. Deploy your facebook app and the bot is live!