Lahiru Sandakith (LahiruS5)

LahiruS5 Member since 2015 7 posts
Posted: March 29, 2018
Last activity: December 9, 2020
Posted: 29 Mar 2018 1:44 EDT
Last activity: 9 Dec 2020 10:54 EST

Facebook Chat Bot Configuration

What is Facebook Chat Bot?

It’s an integration with Facebook messenger app to create cases or displaying a menu of commands.

  • Prerequisites
  • Create a Facebook account.
  • Obtain credentials to a Pega Platform instance.
  • Purchase a separate license for Pega Intelligent Virtual Assistant.
  • Import the FacebookChannel component to Pega Platform
  • Creating Facebook Page

1.Log in to Facebook with your Facebook credentials.

2.Create a Facebook page, and specify its type and category.

3.Display the new Facebook page once it is created. On the left side of the page, click About.

4.In the More Info section, save the generated Page ID for your Facebook page

  • Adding Facebook App

1.Log in to the Facebook developer portal with your Facebook credentials.

2.Add or create a Facebook app, and specify a unique name, contact email address, and the Apps for Messenger category.

3.From the Products section on the left side, click Messenger.

4. From the Token Generation section for the new Facebook Messenger app, in the Page list, click the name of the Facebook page that you created.
5. Verify the security information, and save the page access token that was generated for the new Facebook Messenger app that you created, for example: EAAEZBTukSvHkBAKERVfxZBnOEVNW679G8cQ4...
  • Configuring Webhooks
1.Log in to the Facebook developer portal.
2.Select the previously created Facebook Messenger app.
3.In the Webhooks section for the app, click Setup Webhooks.
4.In the Callback URL field, enter the URL for your Pega Platform instance where you defined your new Facebook channel, for example: http://sample.pega.com:8080/prweb/PRHTTPService/channel/srv/fb
5.In the Verify Token field, enter pega.
6.In the Subscription Fields section, select the messages, messaging_postbacks, and messaging_account_linking check boxes.
7.To subscribe your webhook to the page events, in the Webhooks section, select the created Facebook page and click Subscribe.
8.Click Verify and Save.
**Note :- For webhooks configuration you have to enter https url as callback url. for generate https url you can use ngrok software .

Import FaceBook channel Component

1.Download Facebook Component
2.Go to pega Designer studio ->Application->Distribution->Import
3.Import the downloaded zip file.
4.In Designer Studio, click the name of your application, and click Definition.
5. In the Enabled components section, make sure that the FacebookChannel component is displayed in the list.
  • Setting up a Facebook channel interface in Pega Platform
  • 1.Log in to Pega Express.
    2.From the Pega Express list, click Channels and interfaces.
    3.In the Create new channel interface section, click the Facebook channel.
    4.In the Channel interface name field, enter a name for your Facebook chatbot.
    5.Optional: In the Description field, describe the purpose your Facebook chatbot.
    6.Click the Connection tab.
    7.In the Facebook page ID field, enter the Page ID for the previously created Facebook page.
    8.In the Template operator ID list, click the name of an existing Pega Platform operator to use as the template. For more information, see Additional information about template operator ID.
    9.In the Page access token field, enter the page access token value that was generated for the Facebook Messenger app, for example: EAAEZBTukSvHkBAKERVfxZBnOEVNW679G8cQ4...
  • Adding Case and Questions

1 . Go to the case and add case type

2. Give a Name to Stage

3. Select Facebook Check book

4.Click Configure Conversation and add questions

  • Adding cases to channel

You can add cases for the Facebook chatbot so that users, by entering a specific command in Messenger, open a case for the application. You can select any case that is defined for the Pega Platform application.

•In Designer Studio, click the name of your application and click Channels and interfaces.
•Click a Facebook channel interface.
•Click the Configuration tab.
•To add a new case, click + Add case type.
•In the Name/Command field, enter or modify a user command for the case to be created.
•In the Create case list, click a name of the case to create when the user enters the command.

Go to the Express mode and Select your Channel

***Updated by moderator: Lochan to move post from Pega Academy to PSC***
Conversational Channels Developer Knowledge Share