The DRUID Portal allows you to create the bot once and deploy it on Instagram using the Messenger from Meta.
Prerequisites
- You built and published a DRUID chat bot.
- You have one or more Facebook pages.
- You should have a Instagram Professional account.
- Open the Facebook Page's About page and then copy and save the Page ID.
- For DRUID on premise deployments, make sure that you provide access to/from the necessary messaging endpoints as follows:
Outbound | graph.facebook.com |
Inbound | DRUID.BotApp |
To integrate a DRUID chatbot with Instagram, follow these steps:
Step 1. Link your Instagram professional account to a Facebook page
Go to your Facebook page settings and on the Settings menu, click Linked Accounts.
On the Linked Accounts menu, click Instagram and on the page, click the Connect account button.
In the pop-up that opens, click Connect.
Step 2: Create a Facebook app
- In your browser, navigate to Facebook for Developers and log in.
- On the toolbar, click My Apps. Your Facebook apps page appears.
- Click the Create App button.
- Select the app type.
- Click Next.
- Enter the Display name of your app and select your Business Account account.
- Click Create App.
- For security reasons, re-enter your password and click Submit.
- On the left menu, click Settings > Basic.
- From the right pane, copy and save the App ID and App Secret (click Show , then copy). You will need them at Step 2.
-
Select Clients as App Purpose and at the bottom of the page click the Save changes button.
- On the left menu, click Settings > Advanced.
- In the right pane, set the Allow API Access to app settings slider to Yes.
- Click the Save Changes button to save the settings.
The Facebook app is added to the dashboard.
Step 3. Enable Instagram Messenger
- On the left menu, click Dashboard.
- In the right pane, scroll down and in the Messenger card, click the Set Up button.
- Confirm that you allow access to Instagram messages in Inbox.
The Messenger entry is displayed under the Products section on the left menu.
Step 4. Generate a Page Access Token
To generate a Facebook page access token:
- On the left menu, click Messenger > Instagram Settings.
- Scroll down to the Access Tokens section and click the Add or Remove Pages button.
- Continue as logged in user or log in using another account.
- Select the target page(s).
- Click Continue and then click Save.
- A pop-up appears informing you that you linked your Facebook app to Instagram account.
- Click Got it. The Facebook app appears in the Access tokens section.
- Click the Generate Token button. The Token Generated pop-up appears.
-
Tick I understandand click the Copy button to copy the page access token as you will need it at step 5.
- Click Done.
- You can now exit the Facebook app pages.
Step 5: Configure the DRUID chat bot
- Log in the DRUID Portal and go to your bot configuration page.
- Click the Channels tab, then click Instagram. The Instagram section expands.
- Enter the Facebook App ID and the Facebook App Secret (the App ID and App Secret you copied when creating the Facebook app).
- Click the Add page button (
).
- Enter the Facebook Page ID and Page Access Token and click the Save page button.
- Click the Publish button. The channel activation might take up to 1 minute. When the channel activation completes, the Callback URL and Verify Token fields are automatically filled in. Copy the two values (clicking the Copy icon at the right-side of the two fields) and save them in a file, you will need them at Step 6.
If you host the bot (via Facebook app) in multiple Facebook pages, click the Add page button and enter the Page ID and access token for any subsequent Facebook pages.
After the channel’s activation, the following fields are available in DRUID:
- [[ChatUser]].ChannelId = "instagram"
- [[ChatUser]].UserId - Stores the unique identifier of the Instagram user account.
Step 6: Enable Webhooks
To send messages from your bot to Instagram Messenger, you must enable webhooks integration. To do so, follow these steps:
- Go back to the Facebook app settings. On the left menu, click Messenger > Instagram Settings.
- On the right pane, scroll down to the Webhooks section and click the Add Callback URL button.
- Enter the Callback URL and Verify Token automatically generated in DRUID on the bot Facebook channel and click Verify and Save.
- The Facebook page appears in the Webhooks section but it has no webhook events selected. Click the Edit Subscriptions button.
- Select messages and instagram_manage_messages.
- Click the Save button.
The Edit Instagram Webhook Subscriptions page appears.
Step 7. Establish Instagram Tester permissions
If additional permissions for the Instagram Business Account have not been set up by default, follow these steps:
- On the App Roles menu, click Roles.
- In the App Roles section, click the Add People button. The Add people to your app pop-up appears.
- Select Instagram Tester and enter the username of the Instagram Business Account.
- Click Add.
Now you can start talking to the bot on Instagram.