Facebook Messenger as a RapidPro Channel - Some Basics
May 11, 2016
You may have heard the great news already: Facebook Messenger is now available as a RapidPro channel. This means that besides the existing channels such as SMS, Twitter and Telegram, RapidPro can now also interact with contacts through Facebook Messenger.
The question you are maybe asking yourself now is: how can I get it?
The UNICEF Global Innovation Centre (GIC) has already prepared an extensive guide on how to integrate RapidPro with Facebook Messenger. The guide should be able to take you through the whole process. This post provides some key information you need to know and a number of points to keep in mind if you are planning to add Messenger as a channel in RapidPro.
How does it work?
But let’s first try to understand how it works:
- RapidPro connects to a Facebook app using a webhook. A Facebook app is an application within Facebook that in our case facilitates the interaction between RapidPro and a dedicated Facebook page. When you create an app, you get a page access token that you pass to RapidPro, and RapidPro will give you a callback URL and verify token to pass back to the app.
- The Facebook app is set up at developers.facebook.com. The app connects to a Facebook page using a page access token.
- The Facebook page is the public-facing version of the app. When a user clicks Message on the public Facebook page, they receive a welcome message in a chat box. Users can also search for public pages in messenger.com. The message may include some information about keywords they can use to interact with RapidPro about certain topics.
- End users can interact with RapidPro over Messenger the same way they would use SMS, Twitter, Telegram, etc. Keywords will trigger flows in RapidPro.
So summarizing: RapidPro interacts with a dedicated Facebook page through an App. End users or contacts can then interact with the Facebook page through Facebook messenger. The interactions are built in RapidPro. Data captured will be visible in RapidPro, including unsolicited messages.
What do I need to do to add Messenger as a channel?
These are the steps you need to take to add Messenger as a channel in RapidPro:
- Create an App as a Facebook Developer on https://developers.facebook.com
- Create a Page in Facebook, e.g. U-Report Malaysia
- Add Messenger to your app in developers.facebook.com
- Configure a webhook in developers.facebook.com
- Add the new channel in RapidPro
- Test the connection between RapidPro and Facebook Messenger.
What does a contact need to do to interact with RapidPro through messenger?
Initiating conversations from RapidPro works only for Facebook users who have clicked Message on the public Facebook page. So a Facebook user has to be the first initiating the interaction. It is therefore important to set a clear welcome message in which you explain to the user which triggers to use for joining particular initiatives.
Users can also find your page by searching for public pages in messenger.com.
- All U-Report countries are already in the process of setting up Facebook Messenger with active support from GIC.
- Facebook Messenger as a RapidPro channel will only work if you take the time to set up the keyword triggers in RapidPro (e.g. join). If you want something to happen when you send the word ‘hi’ or ‘test’, you have to set up flows in your RapidPro account that map out the conversations when someone sends ‘hi’ or ‘test’ as a keyword trigger.
- In order to test the connection between RapidPro and Facebook Messenger while your app is in development mode, you have to add people as admins in your app (in developer.facebook.com) and as admins on the facebook page. They must be added to both in those specific roles in order to interact with RapidPro through the facebook page while your app is in development mode.