Using the Dialogflow Facebook Workplace integration, you can create a Workplace from Facebook bot to interact with your end-users.
Limitations
Only the default agent language is supported by this integration.
How it works
This is how the integration works:
- You configure the Dialogflow integration and Workplace instance, so that they communicate with each other.
- The Dialogflow integration sends messages to the end-user by using the Messenger API from Facebook.
- The Dialogflow integration receives messages from the end-user by acting as the Workplace Webhook from Facebook.
Start
To start the integration:
Register a Workplace instance if you don't have one, and make sure you are the System Admin of the group.
Enable the integration from the Dialogflow Console:
- Go to the Dialogflow ES console.
- Click Integrations in the left sidebar menu.
- Click Workplace from Facebook.
- Click START and you will be redirected to Workplace to finish the installation:
- Log into your Workplace account. The account needs to be a System Admin on Workplace to install integrations.
- Click Add to Workplace in the pop-up window that asks you to install Dialogflow integration. You also have the option to customize the name for the bot.
Test your app:
- Go to Workplace and log into the account.
- Find Dialogflow (or the customized name of your bot) in Bots from the Home section of the sidebar and start chatting with the bot.
Cancel
If you clicked the START button but do not want to finish the installation on Workplace:
Go to the Dialogflow ES console.
Click Integrations in the left sidebar menu.
Click Facebook Workplace:
- If you see a CANCEL button: Click CANCEL to cancel the installation.
- If you see a STOP button: Follow instructions below to uninstall the integration.
Stop
To stop a successfully installed integration:
Go to the Dialogflow ES console.
Click Integrations in the left sidebar menu.
Click Facebook Workplace.
Click STOP and you will be redirected to Workplace to finish the installation:
- Log into your Workplace account. The account needs to be a System Admin on Workplace to uninstall integrations.
- Find and select the Dialogflow integration from the installed integrations on Workplace, click Uninstall to finish the uninstallation.
Dialogflow integration will be uninstalled.
Rich response messages
This integration translates some rich response messages messages to Facebook Messenger Platform message types.
Image responses
Image responses
are sent to Facebook Messenger as
Facebook Messenger file attachment messages.
The message.attachment.type
value is set to image
.
The following formats are supported:
- jpg
- png
- static gif
- animated gif
Card responses
Card responses are sent to Facebook Messenger as Facebook Messenger generic templates.
Quick reply responses
Quick reply responses are sent to Facebook Messenger as Facebook Messenger quick replies.
Custom payload responses
To send other types of Facebook Messenger messages, you can use a custom payload.
The general format of the custom payload looks like:
{ "facebook": { message } }
In place of message
, provide the Facebook Messenger message
object.
For details of the message
object, see the
Facebook Messenger API reference.
For example:
-
Send an audio link:
{ "facebook": { "attachment": { "type": "audio", "payload": { "url": "https://example.com/audio/test.mp3" } } } }
-
Send a playable video:
{ "facebook": { "attachment": { "type": "video", "payload": { "url": "https://example.com/video.mp4" } } } }
-
Send a file:
{ "facebook": { "attachment": { "type": "file", "payload": { "url": "https://example.com/file.pdf" } } } }
Limitations
A Dialogflow agent can only be installed on one Workplace instance, but you can install multiple Dialogflow agents on one Workplace instance.
To remove a failed installation, you need to both cancel the installation on Dialogflow and remove the installation on Workplace.
Migration
If you are using Messenger integration and you are going to migrate it to Workplace integration, you'll need to:
Stop the Messenger integration.
Remove the callback_url on the Facebook app by reversing steps in Setting Up Your Facebook App.
Start the Workplace integration following steps above.