メニュー

Expand
Rate this page:

Thanks for rating this page!

We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

Facebook Messenger

For more about using Facebook Messenger with Twilio, see the documentation on Twilio Channels.

With Twilio Autopilot, you can build Facebook Messenger bots. On this page, we'll walk you through how to link your Facebook account to Autopilot so you can get started building your Facebook Messenger bot.

Before you begin:

  1. You must have a Facebook Page for your brand or business. If you don't have one follow these instructions to create one here.
  2. Download the Messenger App for your phone here: iOS - Android.
  3. Make sure you have created an Autopilot assistant to power the Facebook Messenger Bot.

はじめる

Once you have the Facebook page and the Messenger app installed you'll need to link your Facebook page with Twilio, and then configure the FB Messenger channel on Twilio to point to Autopilot. We'll walk you through step by step.

  1. First, you need to install the FB Messenger channel on your Twilio Account. Go here and click install.
  2. Once installed, you'll see a Configure section.
  3. In the Properties section, select Use in -> Programmable SMS Inbound
  4. In the Credentials section, click the Facebook Log in button to link and follow the instructions. This will link your Facebook page with your Twilio Account.
  5. Select the Facebook page that you want to build your Bot for. You'll see most of the Configuration fields auto-populate below.
  6. At this point, we need to configure the Callback URL with the Autopilot URL for Facebook Messenger. So, open a new tab, and to Autopilot in the Twilio Console.
  7. On the left-hand menu, click Assistants. Then click on the assistant that is going to power the Facebook Messenger Bot.
  8. Then click Channels. You'll see a Facebook Messenger tile. Click on it and make sure you're on Configuration.
  9. You will see a URL, copy that URL, then go back to the FB Messenger Configuration page and paste that URL on the Callback URL field.
  10. Hit save and you're all set!

テスト

Now that you have Facebook Messenger configured it's time to test!

  • Open your Facebook Messenger app on your mobile
  • Search for the name of your Facebook page
  • Send your first message, you should get a response from Autopilot
  • Check the Autopilot Query logs, you should see the message you sent from Facebook Messenger in the query logs.

Autopilot URL Parameters

パラメーター 概要
TargetTask

A string representing the unique name of the destination Task. If no TargetTask is provided, the destination task is determined by the natural language understanding.


TargetTask is useful when you want to control what task a user is routed to.

For Example: Note the TargetTask parameter at the end of the URL

https://channels.autopilot.twilio.com/v1/<ACCOUNT_SID>/<ASSISTANT_SID>/facebook-messenger?TargetTask=handle_appointment_confirmation

Any message sent to number or messaging service configured with this URL will land in the handle_appointment_confirmation task.

Rate this page:

ヘルプが必要ですか?

誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。