Skip to main content

Instagram channel

You can connect your bot to the Instagram account so that it could communicate with your clients via Direct.

To configure the integration, you will need the Instagram business account connected to the Facebook Business Manager account.

Also, before you start to configure the integration, you need to create a company Page on Facebook in case you do not have it.

To use Instagram as an inbound channel:

  1. Create an app on Facebook.
  2. Add Facebook and Instagram accounts to the app.
  3. Create an Instagram channel in Tovie Platform.
  4. Get and use a webhook.
  5. Test the bot.
  6. Go through the App Review process on Facebook.

Integration features

The Instagram channel supports the following functions:

  • sending images;
  • sending audio and video files;
  • transferring the dialog to the agent;
  • integration with CRM systems;
  • sending emails and SMS.
Buttons are not supported in this integration.

Configure an app on Facebook

Create an app

  1. Open the Facebook for Developers page.
  2. Click Log in and log in to your Facebook account.
  3. Select Get started on the main page of Facebook for Developers.
  4. Go through all the steps to create your account on Facebook for Developers.
  5. After you have created an account, go to the My Apps tab, click the Create App button and choose the Business app type.
  6. Name the app and choose Yourself or your own business as the app purpose. Add your Business Manager account and save the settings.

After you have done it, you will be taken to the page of your app.

Add Facebook and Instagram accounts

On the app page, go to the Dashboard tab from the sidebar. Find Add Products to Your App section and choose Messenger, then go to the Instagram Settings tab.

To add accounts, follow the steps below:

  1. In the Access Tokens section, click the Add or Remove Pages button. The new window for Facebook authorization will open. Click Continue as (your account name).
  2. Choose the Instagram business account you are going to use in the integration, then click Next.
  3. Choose the Facebook Page you are going to use in the integration.
  4. Specify permissions you give to the app. For correct work of the integration, all permissions should be activated. Click Done, and the app will be connected to Facebook. The Page will occur in the Access Tokens section.

Create a channel

On your project page, go to Channels → Inbound → Connect channel. Choose the Instagram channel.

Fill out the fields:

  • Name — choose any name you like. You can change it later.
  • Access token — paste the access token that you have copied before.
  • Branch — specify the project branch you want to deploy into the channel (master by default). You can also select a Git tag or enter a specific commit hash.
  • Agent — choose the customer engagement platform if you have added one.
  • Deployment — select Automatic (whenever any change made to the project is saved) or Manual (using the Deploy button in the channel description line).
You have to deploy a script before starting the bot. At this stage, the system builds the bot, checks the script syntax, and performs tests.

Click Create. Wait for a pop-up window with the deploy result to appear.

Get a webhook

Click Get webhook under the name of the channel. The webhook address will be copied to the clipboard.

Go back to the Instagram Settings page and follow the steps:

  1. In the Webhooks section, select Add Callback URL. In the modal window, paste the webhook you have copied into the Callback URL field.
  2. Paste tovieai_verify_token into the Verify Token field. Click Verify and Save.
  3. Click the Edit Subscriptions button. Activate the messages and messaging_postbacks parameters, then click Save.
  4. Reload the page. Select the Webhooks tab from the sidebar and choose Permissions from the drop-down list.
  5. Click Subscribe to this object and fill out the fields as specified in steps 1 and 2, then click Verify and Save.
  6. Find instagram_basic, instagram_manage_messages, and pages_manage_metadata permissions. Click Subscribe near each of the parameters.

After you make all the steps, the integration will be ready for testing.

Test the bot

To test the bot, you should add another Facebook account as a tester on the page of the Facebook app.

For doing this:

  1. Choose the Roles page in the sidebar and click the Add testers button in the Testers section.
  2. In the modal window, specify the name or identifier of the tester’s account and click Submit. The account will be added to the section with Pending status.
  3. Log in to Facebook with the account you have added as a tester, then approve the request for adding the account to the list of testers.
  4. Log in to Instagram with the account connected to the Facebook account you have added as a tester.
  5. Go to the page of the Instagram account you have added when configuring the app. Send a message via Direct.

If you have configured everything correctly, the bot will answer according to the script.

Go through the App Review process

To make the bot reply to messages sent from any people, not only those with a direct role on the app, you need to go through the App Review for Instagram Messaging Apps.

First of all, make sure your app does not contradict:

Before you submit your app, make sure it functions correctly.

If Facebook is unable to test the app functionality, or the functionality does not work as described, your app will not be approved.

To submit your app:

  1. On the app page, go to App Review > Requests and click Request Permissions or Features.
  2. For instagram_basic, instagram_manage_messages, and Human Agent parameters, click Request Advanced Access in the Action column.
  3. Go to the Requests tab and click Edit for the draft request with these parameters.
  4. Fill in the request form according to the instruction. While filling it in, you must include screen recordings that show how to test any functionality that relies on that permission or feature.
  5. After you complete the request, click Submit for Review.

Wait for Facebook’s decision on your app. If your request is approved, you can start using the Instagram integration.