You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Your bot can be connected to both Facebook Messenger and Facebook Workplace, so that it can communicate with users on both platforms. The following tutorial shows how to connect a bot to these two channels step by step.
14
+
Your bot can be connected to both Facebook Messenger and Facebook Workplace, so that it can communicate with users on both platforms. The following tutorial shows how to connect a bot to these two channels.
17
15
18
16
> [!NOTE]
19
17
> The Facebook UI may appear slightly different depending on which version you are using.
@@ -22,74 +20,95 @@ Your bot can be connected to both Facebook Messenger and Facebook Workplace, so
22
20
23
21
To learn more about developing for Facebook Messenger, see the [Messenger platform documentation](https://developers.facebook.com/docs/messenger-platform). You may wish to review Facebook's [pre-launch guidelines](https://developers.facebook.com/docs/messenger-platform/product-overview/launch#app_public), [quick start](https://developers.facebook.com/docs/messenger-platform/guides/quick-start), and [setup guide](https://developers.facebook.com/docs/messenger-platform/guides/setup).
24
22
25
-
To configure a bot to communicate using Facebook Messenger, enable Facebook Messenger on a Facebook page and then connect the bot to the app.
23
+
To configure a bot to communicate using Facebook Messenger, enable Facebook Messenger on a Facebook page and then connect the bot.
26
24
27
25
### Copy the Page ID
28
26
29
-
The bot is accessed through a Facebook Page.[Create a new Facebook Page](https://www.facebook.com/bookmarks/pages) or go to an existing Page.
27
+
The bot is accessed through a Facebook Page.
30
28
31
-
* Open the Facebook Page's **About** page and then copy and save the **Page ID**.
29
+
1.[Create a new Facebook Page](https://www.facebook.com/bookmarks/pages) or go to an existing Page.
30
+
31
+
1. Open the Facebook Page's **About** page and then copy and save the **Page ID**.
32
32
33
33
### Create a Facebook app
34
34
35
-
[Create a new Facebook App](https://developers.facebook.com/quickstarts/?platform=web) on the Page and generate an App ID and App Secret for it.
35
+
1. In your browser, navigate to [Create a new Facebook App](https://developers.facebook.com/quickstarts/?platform=web).
36
+
1. Enter the name of your app and click the **Create New Facebook App ID** button.

59
+
60
+
1. In the page bottom right, click the **Save Changes** button.
46
61
47
62
### Enable messenger
48
63
49
-
Enable Facebook Messenger in the new Facebook App.
64
+
1. In the left pane, click **Dashboard**.
65
+
1. In the right pane, scroll down and in the **Messenger** box, click the **Set Up** button. The Messenger entry is displayed under the *PRODUCTS* section in the left pane.
1. Click the **Edit Permissions** button to grant the app pages_messaging in order to generate an access token.
77
+
1. Follow the wizard steps. In the last step accept the default settings and click the **Done** button. At the end a **page access token** is generated.
In order to send messages and other events from your bot to Facebook Messenger, you must enable webhooks integration. At this point, let's leave the Facebook setting steps pending; will come back to them.
68
86
69
-
In the [Azure portal](https://portal.azure.com/), open the bot, click the **Channels** tab, and then click **Facebook Messenger**.
87
+
1.In your browser open a new window and navigate to the [Azure portal](https://portal.azure.com/).
70
88
71
-
* Copy the **Callback URL** and **Verify Token** values from the portal.
89
+
1. In the Resource list, click on the bot resource registration and in the related blade click **Channels**.
1. In the right pane, click the **Facebook** icon.
74
92
75
-
1.Return to Facebook Messenger and paste the **Callback URL** and **Verify Token** values.
93
+
1.In the wizard enter the Facebook information stored in the previous steps. If the information is correct, at the bottom of the wizard, you should see the **callback URL** and the **verify token**. Copy and store them.
76
94
77
-
2. Under **Subscription Fields**, select *message\_deliveries*, *messages*, *messaging\_optins*, and *messaging\_postbacks*.
1. Let's go back to the Facebook settings. In the right pane, scroll down and in the **Webhooks** section, click the **Subscribe To Events** button. This is to forward messaging events from Facebook Messenger to the bot.
1. In the displayed dialog, enter the **Callback URL** and **Verify Token** values stored previously. Under **Subscription Fields**, select *message\_deliveries*, *messages*, *messaging\_optins*, and *messaging\_postbacks*.
In Azure portal, paste the **Facebook App ID**, **Facebook App Secret**, **Page ID**,and **Page Access Token** values copied from Facebook Messenger previously. You can use the same bot on multiple facebook pages by adding additional page ids and access tokens.
108
+
1. Click the **Verify and Save** button.
109
+
1. Select the Facebook page to subscribe the webhook. Click the **Subscribe** button.
@@ -111,30 +130,25 @@ See the [Workplace Help Center](https://workplace.facebook.com/help/work/) to le
111
130
112
131
To configure a bot to communicate using Facebook Workplace, create a custom integration and connect the bot to it.
113
132
114
-
### Create a Facebook Workplace Premium account
115
133
116
-
Following the instructions [here](https://www.facebook.com/workplace) to create a Facebook Workplace Premium account and set yourself as the system administrator. Please keep in mind that only system administrator of a Workplace can create custom integrations.
134
+
1. Create a Facebook Workplace Premium account. Follow the instructions [here](https://www.facebook.com/workplace) to create a Facebook Workplace Premium account and set yourself as the system administrator. Please keep in mind that only system administrator of a Workplace can create custom integrations.
117
135
118
-
###Create a custom integration
136
+
1. Create a [custom integration](https://developers.facebook.com/docs/workplace/custom-integrations-new) for your Workplace following the steps described next. When you create a custom integration, an app with defined permissions and a page of type 'Bot' only visible within your Workplace community are created.
119
137
120
-
When you create a custom integration, an app with defined permissions and a page of type 'Bot' only visible within your Workplace community are created.
138
+
1. In the **Admin Panel**, open the **Integrations** tab.
139
+
1. Click on the **Create your own custom App** button.
121
140
122
-
Create a [custom integration](https://developers.facebook.com/docs/workplace/custom-integrations-new) for your Workplace following the steps below:
- Choose a display name and a profile picture for the app. Such information will be shared with the page of type 'Bot'.
130
-
- Set the **Allow API Access to App Settings** to "Yes".
131
-
- Copy and safely store the App ID, App Secret and App Token that's shown to you.
149
+
1. Now you have finished creating a custom integration. You can find the page of type 'Bot' in your Workplace community,as shown below.
132
150
133
-

134
-
135
-
Now you have finished creating a custom integration. You can find the page of type 'Bot' in your Workplace community, as shown below.
136
-
137
-

151
+

138
152
139
153
### Provide Facebook credentials
140
154
@@ -150,12 +164,10 @@ Please refer to the **Connect a bot to Facebook Messenger** section for details.
150
164
151
165
If you receive a notification from Facebook about deprecation of a certain version of the Graph API, go to [Facebook developers page](https://developers.facebook.com). Navigate to your bot’s **App Settings** and go to **Settings > Advanced > Upgrade API version**, then switch **Upgrade All Calls** to 3.0.
152
166
153
-

154
-
155
-
## Sample code
167
+

156
168
157
-
For further reference the <ahref="https://aka.ms/facebook-events"target="_blank">Facebook-events</a> sample bot can be used to explore the bot communication with Facebook Messenger.
169
+
## See also
158
170
159
-
## Also available as an adapter
171
+
-**Sample code**. Use the <ahref="https://aka.ms/facebook-events"target="_blank">Facebook-events</a> sample bot to explore the bot communication with Facebook Messenger.
160
172
161
-
This channel is also [available as an adapter](https://botkit.ai/docs/v4/platforms/facebook.html). To help you choose between an adapter and a channel, see [Currently available adapters](bot-service-channel-additional-channels.md#currently-available-adapters).
173
+
-**Available as an adapter**. This channel is also [available as an adapter](https://botkit.ai/docs/v4/platforms/facebook.html). To help you choose between an adapter and a channel, see [Currently available adapters](bot-service-channel-additional-channels.md#currently-available-adapters).
0 commit comments