content
FacebookMessenger
  Last updated: 16/11/2017
  • Installs:
  • Today: 0
  • This Week: 7
  • This Month: 9
  • All Time: 117
Developer:userdimashirokov

FacebookMessenger API Package

Send and recive messages using Facebook Messenger API.

List of Endpoints
This is the list of endpoints this API includes. To add of the endpoints to your app, please click on “Connect to endpoint” text.
See All
List of Webhook Events
This is the list of webhook events this API provides. Webhooks allow you to register to certain events and receive real-time data over websockets.
See All
Discussions
See All
Readme

FacebookMessenger

FacebookMessenger Package

  • Domain: Facebook
  • Credentials: pageAccessToken

How to get credentials

Facebook Messenger API Quick Start

FacebookMessenger.sendTextMessage

Send Text Message

FieldTypeDescription
pageAccessTokencredentialsYour Page Token
recipientIdStringID of Recipient
messageStringThe message to be sent

FacebookMessenger.subscribeAppToPage

Subscribe an app to get updates for a page.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com

FacebookMessenger.validateWebhook

Test if your webhook works correctly and you're subscribed to a page.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
appIdStringApp ID obtained from developer.facebook.com
pageIdStringPage ID obtained from developer.facebook.com

FacebookMessenger.sendAction

Set typing indicators or send read receipts using the Send API, to let users know you are processing their request.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID
senderActionSelectmark_seen: Mark last message as read; typing_on: Turn typing indicators on; typing_off: Turn typing indicators off.

FacebookMessenger.sendImage

You can send images by uploading them or sharing a URL using the Send API. Supported formats are jpg, png and gif.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID
imageFileImage to send

FacebookMessenger.getUserProfile

Returns a json string with the requested details about the user.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
userIdStringUser ID
fieldsListComma separated fields string: first_name, last_name, profile_pic, locale, timezone, gender

FacebookMessenger.setPersistentMenu

The Persistent Menu is a menu that is always available to the user. This menu should contain top-level actions that users can enact at any point. Having a persistent menu easily communicates the basic capabilities of your bot for first-time and returning users. The menu can be invoked by a user, by tapping on the 3-caret icon on the left of the composer.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
callToActionsJSONArray of menu_item object

FacebookMessenger.deletePersistentMenu

Delete the Psersistent Menu.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com

FacebookMessenger.setGetStartedButton

The Welcome Screen can display a Get Started button. When this button is tapped, we will trigger the postback received callback and deliver the person's page-scoped ID (PSID). You can then present a personalized message to greet the user or present buttons to prompt him or her to take an action.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
payloadStringThis data will be sent back to you via webhook.

FacebookMessenger.deleteGetStartedButton

Delete the Get Started button.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com

FacebookMessenger.setGreetingText

You can set a greeting for new conversations. This can be used to communicate your bot's functionality. If the greeting text is not set, the page description will be shown in the welcome screen. You can personalize the text with the person's name.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
textStringGreeting text

FacebookMessenger.deleteGreetingText

Delete the Greeting Text.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com

FacebookMessenger.setWhitelist

Domain whitelisting is required to use Messenger Extensions.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
whitelistedDomainsListA list of domains being used with URL Buttons and Messenger Extensions. All domains must be valid and use https. Up to 10 domains allowed.
domainActionTypeStringOperation when setting domain. Valid values: add, remove

FacebookMessenger.sendQuickReplyButton

Quick Replies provide a new way to present buttons to the user. Quick Replies appear prominently above the composer, with the keyboard less prominent. When a quick reply is tapped, the message is sent in the conversation with developer-defined metadata in the callback. Also, the buttons are dismissed preventing the issue where users could tap on buttons attached to old messages in a conversation.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
messageJSONMessgae Object.

FacebookMessenger.sendShareLocationReplyButton

Method description

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
textStringText of message.

FacebookMessenger.sendGenericTemplate

Use the Generic Template with the Send API to send a horizontal scrollable carousel of items, each composed of an image attachment, short description and buttons to request input from the user.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
elementsJSONData for each bubble in message.

FacebookMessenger.sendButtonTemplate

Use the Button Template with the Send API to send a text and buttons attachment to request input from the user. The buttons can open a URL, or make a back-end call to your webhook.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
buttonsJSONArray of button objects.
textStringText that appears in main body

FacebookMessenger.sendReceiptTemplate

Use the Receipt Template with the Send API to send a order confirmation, with the transaction summary and description for each item.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
recipientNameStringRecipient's name.
orderNumberStringRequired & unique: Order number.
currencyStringCurrency for order.
paymentMethodStringRequired: Payment method details. This can be a custom string. ex: "Visa 1234".
orderUrlStringURL of order.
timestampStringTimestamp of the order, in seconds.
elementsJSONItems in order.
addressStreet1StringStreet address, line 1
addressStreet2StringStreet address, line 2
addressCityStringCity
addressPostalCodeStringPostal code
addressStateStringState abbreviation or Region/Province (international)
addressCountryStringTwo-letter country abbreviation
summarySubtotalStringSubtotal
summaryshippingCostStringCost of shipping
summaryTotalTaxStringTotal tax
summaryTotalCostStringTotal cost
adjustmentsJSONPayment adjustments.

FacebookMessenger.sendUrlWebButton

The URL Button can be used to open a web page in the in-app browser. This button can be used with the Button and Generic Templates.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
titleStringButton title. 20 character limit.
elementTitleStringElement Title.
elementItemUrlStringElement Item Url.
elementImageUrlStringElement Image Url.
elementSubtitleStringElement Subtitle.
urlStringThis URL is opened in a mobile browser when the button is tapped
webviewHeightRatioSelectHeight of the Webview. Valid values: compact, tall, full.
messengerExtensionsStringMust be true if using Messenger Extensions.
fallbackUrlStringURL to use on clients that don't support Messenger Extensions. If this is not defined, the url will be used as the fallback.

FacebookMessenger.sendPostbackButton

When a Postback Button is tapped, we will send a call to your webhook. This is useful when you want to send a person's action to your bot. This button can be used with the Button and Generic Templates.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
elementTitleStringElement Title.
elementItemUrlStringElement Item Url.
elementImageUrlStringElement Image Url.
elementSubtitleStringElement Subtitle.
titleStringButton title. 20 character limit.
payloadStringThis data will be sent back to your webhook. 1000 character limit.

FacebookMessenger.sendCallButton

The Call Button can be used to initiate a phone call. This button can be used with the Button and Generic Templates.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
titleStringButton title. 20 character limit.
textStringText of message
payloadStringFormat must have '+' prefix followed by the country code, area code and local number. For example, +16505551234.

FacebookMessenger.sendShareButton

The Share Button enables people to share message bubbles with their contacts using a native share dialog in Messenger.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
elementTitleStringElement Title.
elementItemUrlStringElement Item Url.
elementImageUrlStringElement Image Url.
elementSubtitleStringElement Subtitle.

FacebookMessenger.sendAccountLinkButton

The account linking authentication flow can be triggered by using a specific button type described below.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
elementTitleStringElement Title.
elementItemUrlStringElement Item Url.
elementImageUrlStringElement Image Url.
elementSubtitleStringElement Subtitle.
urlStringAuthentication callback URL. Must be using https protocol.

FacebookMessenger.sendAccountUnlinkButton

Account unlinking can be triggered by using a specific type of button described below.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
elementTitleStringElement Title.
elementItemUrlStringElement Item Url.
elementImageUrlStringElement Image Url.
elementSubtitleStringElement Subtitle.

FacebookMessenger.sendAirlineItineraryTemplate

Send a confirmation message that contains the itinerary and receipt.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
introMessageStringIntroduction message.
localeStringTwo-letter language region code.
themeColorStringBackground color of the attachment
pnrNumberStringRequired: Passenger name record number (Booking Number).
passengerInfoJSONPassenger name record number (Booking Number). Array of passenger_info
flightInfoStringInformation about a flight. Array of flight_info
passengerSegmentInfoJSONInformation about a passenger. Array of passenger_segment_info.
priceInfoJSONItemization of the total price
basePriceNumberItemization of the total price
taxNumberTax amount
totalPriceNumberTotal price for the booking
currencyStringPricing currency

FacebookMessenger.sendAirlineCheckinTemplate

Send a check-in reminder message.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
introMessageStringIntroduction message.
localeStringTwo-letter language region code.
themeColorStringBackground color of the attachment
pnrNumberStringRequired: Passenger name record number (Booking Number).
flightInfoJSONInformation about a flight. Array of passenger_segment_info
checkinUrlStringURL for passengers to check-in

FacebookMessenger.sendAirlineBoardingPassTemplate

Send a message that contains boarding passes for one or more flights or one more passengers. Message bubbles will be grouped by flight information -- if the flight information matches, all passengers will be share the same bubble. Multiple bubbles are automatically sent for all boarding_pass elements with different values for flight_info. In the future, we may group all boarding passes into the same bubble.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
introMessageStringIntroduction message.
localeStringTwo-letter language region code.
themeColorStringBackground color of the attachment
boardingPassJSONBoarding passes for passengers.

FacebookMessenger.sendAirlineFlightUpdateTemplate

Send flight status update message.

FieldTypeDescription
pageAccessTokencredentialsPage Access Token obtained from developer.facebook.com
recipientIdStringRecipient ID.
introMessageStringIntroduction message.
updateTypeStringType of update for this notification.
localeStringTwo-letter language region code.
themeColorStringBackground color of the attachment
pnrNumberStringPassenger name record number (Booking Number).
updateFlightInfoFlightNumberStringFlight number
updateFlightInfoDepartureAirportJSONDeparture airport (airport object)
updateFlightInfoArrivalAirportJSONArrival airport
updateFlightInfoFlightScheduleJSONSchedule for the flight. flight_schedule object
x
circle
FacebookMessenger
$ / m
We will charge your card every month for the plan amount, as well as any overages incurred in the previous month.
?

Oops, we are missing some details

Looks like there are a few missing details that you haven't filled in yet.
These details are important and will help us protect you and let you know about anything new.

x

Connect your app to APIs via RapidAPI

Consume and monitor multiple APIs through the RapidAPI SDK.
Click start to set up your app and connect to your first API.

START

Give your app a name

This app will be used in RapidAPI to collect and connect all the APIs you need.

NEXT

Connect your project

Choose your backend language and then install & require the RapidAPI SDK.

  • node
    NodeJS
  • php
    PHP
  • python
    Python
  • objc
    Obj-C
  • android
    Android
  • go
    GO
  • ruby
    Ruby
  • csharp
    C#

Install SDK

Run the following command to install the SDK:

npm install rapidapi-connect --save

Require SDK

In your code, add the following code to require the RapidAPI SDK:

NEXT

Hooray! You are connected

Use the following code to try it out by getting all the APIs that are on RapidAPI.

rapid.call('RapidAPI', 'getAll', {'{}'});
FINISH
esccloses this view
x

Login to RapidAPI

Create endpoints based on popular APIs and share with others.
Follow popular APIs and get updated. Stand out in the community of developers.

LOG INSIGN UP
Login with Github
Login with Facebook
Login with Google
Or
Remember Me

  • We're not going to post anything on your wall.
  • We're not planning to spam you.
  • esccloses this view
    x

    Why sign up to RapidAPI?

    • integrate
      Integrate APIs into your app
      Ruby, Java, Elixir, Node.js, Phyton, Objective C, Swift, PHP and MORE
    • keys
      Save all API keys in one place
    • notifications
      Get notifications about API changes
    • stats
      Get stats and monitor API connections
    Sign up with Github
    Sign up with Facebook
    Sign up with Google
  • We're not going to post anything on your wall.
  • We're not planning to spam you.
  • esccloses this view
    x

    Authentication

    Authenticate
    esccloses this view