Skip to main content
Open in Hubv4.1.0 The official Messenger integration allows users to chat with your bot by messaging a Facebook page.

Setup

  • Basic configuration
  • Manual configuration
  • Playground
You will need:
  1. In Botpress Studio, select Explore Hub in the upper-right corner.
  2. Search for the Messenger integration, then select Install Integration.
  3. In the Configuration menu, select Authorize Messenger.
  4. Follow the instructions to connect Botpress to your Messenger account.

Options

The Messenger integration’s Configuration menu offers a few additional options:

Get user profile

When this option is enabled (default), the integration will update the Botpress user’s name and picture URL with data from Messenger.
This option is only available with manual configuration.

Download media

When enabled, this option automatically downloads media files using the Files API. When disabled, media files are displayed using their Messenger media URL.

Downloaded media expiry

Expiry time (in hours) for downloaded media files. An expiry time of 0 means the files will never expire. Defaults to 24 hours.

Cards

Here’s a reference for all Cards available with the integration:

Get Or Create Conversation

Input: Output:

Get or Create a User

Input: Output:

Start Typing Indicator

Input: Output: This Card has no output.

Stop Typing Indicator

Input: Output: This Card has no output.

Tags

You can read event tags to get information about an active Messenger conversation:

Message ID

To get the Messenger ID of a message:
event.tags.message["messenger:id"]

Recipient ID

To get the Messenger ID of the recipient:
event.tags.message["messenger:recipientId"]
or
event.tags.conversation["messenger:recipientId"]

Sender ID

To get the Messenger ID of the sender:
event.tags.message["messenger:senderId"]
or
event.tags.conversation["messenger:senderId"]

Conversation ID

To get the Messenger ID of the conversation:
event.tags.conversation["messenger:id"]

User ID

To get the Messenger ID of the user:
event.tags.user["messenger:id"]
I