- A Meta developer app (opens in a new tab)
- A Facebook page (opens in a new tab) in which you have the administrator or developer roles
- An Instagram Professional account (opens in a new tab)
- Go to the Integration Hub (opens in a new tab) in Botpress Cloud (if you don't have the integration installed yet).
- Find and open the Instagram integration then click on the "Install to Bot" button, now go back to your bot settings.
The Instagram integration has the following settings:
- Enabled: Whether Botpress will communicate with Instagram
- Webhook URL: The URL for receiving data in Botpress
- App ID: The ID of your Meta app
- App Secret: The secret of your Meta app
- Verify Token: The token used to verify the webhook requests
- Page ID: The ID of your Facebook page
- Access Token: The access token
If you do not already have a Facebook page you will need to create one. You can find details on how to create a new Facebook page here (opens in a new tab). To link your chatbot to a pre-existing page, you must have an administrator or developer role.
- Give a name to your Facebook Page.
- Pick a Category.
- Log in to your Facebook account and go to the Facebook for Developers website (opens in a new tab).
- Select My Apps from the top menu, and create a new app.
- Select Business as App Type.
- Give a name to your App.
Messenger is the proxy for Instagram settings, and since is not added by default in your Meta app it must be added manually.
- In the left sidebar of your app dashboard, click on Add Product.
- Look for Messenger and click Set Up.
Botpress can interact with the version 15.0 or higher of the Instagram API. It is not the default version so it must be changed in your app's settings
- Go to your Meta app.
- In the left sidebar, expand the Settings menu and select Advanced.
- In the Upgrade API version section, select v15.0 or higher as the API version.
- Click on Save Changes.
- In the left sidebar, expand the Settings menu and select Basic. Here you can find the App ID and App Secret.
- Click on the Show button in the App Secret text box. Copy the App Id and App Secret to your channel configuration.
- In the left sidebar, expand the Messenger menu and select Instagram Settings
- In the Access Tokens section, click Add or Remove Pages and add your Facebook page.
- Copy the number under you page name and paste it in you Page ID channel configuration.
- Click on Generate Token. Copy this token and paste it in the Access Token channel configuration.
The Verify Token is used by Facebook to verify that you are the real owner of the provided webhook.
You can generate any random alphanumerical string for this configuration. Paste it in your Verify Token channel configuration.
Channel configuration is completed, you can now click Save. It is important you save your configuration before configuring the webhook, otherwise Messenger will be unable to validate the webhook URL.
To receive messages from Instagram in your Botpress bot, you will need to setup some webhook settings.
- Go to your Meta App.
- In the left sidebar, expand the Messenger menu and select Settings.
- In the Webhooks section, click Add Callback URL.
- Copy and paste the webhook URL provided in the channel configuration UI.
- Copy and paste the Verify Token you generated earlier.
- Click on Verify and Save. Make sure your channel configuration was saved before doing this step, otherwise the webhook validation will fail.
- Click on Add Subscriptions and add messages, instagram_manage_messages and messaging_postbacks to your webhook.
Note: If you can't find the above permissions, then you need to get your meta app reviewed first https://developers.facebook.com/docs/permissions/ (opens in a new tab)
That's it, you may now start chatting with your bot on Instagram!
When your app is in Development Mode, your bot will work for admins, developers, and testers of the app. After your app is approved and made public, it will work for the general public. https://developers.facebook.com/docs/app-review/support/rejection-guides/instagram/ (opens in a new tab)