Messenger Profile API

The Messenger Profile for your bot is where you set properties that define various aspects of the following Messenger Platform features. For more information, see the Messenger Profile Properties table below.

The Messenger Profil API allows you to set, update, retrieve, and delete properties from your bot's Messenger Profile.

Contents

Request URI

https://graph.facebook.com/v2.6/me/messenger_profile?access_token=<PAGE_ACCESS_TOKEN>

Messenger Profile Properties

The following properties may be included in the Messenger profile for your bot. See descriptions in the table below for the type and purpose of each property.

Property Type Description

account_linking_url

String

Authentication callback URL. Must use https protocol.


For more, see Account Linking URL Reference.

persistent_menu

Array<Object>

An array of call-to-action buttons to include in the persistent menu.


For more, see Persistent Menu Reference.

get_started

Object

The payload that will be sent as a messaging_postbacks event when someone taps the 'get started' button on your bot's welcome screen.


For more, see Get Started Button Reference.

greeting

Array<Object>

An array of locale-specific greeting messages to display on your bot's welcome screen.


For more, see Greeting Text Reference.

whitelisted_domains

Array<String>

A list of whitelisted domains. Required for bots that use the Messenger Extensions SDK and the checkbox plugin.


For more, see Domain Whitelisitng Reference.

payment_settings

Object

Settings for implementing payments, including privacy policy URL, public key, and test users.


For more, see Payment Settings Reference.

target_audience

Object

A set of criteria that determines the audience that your bot will appear for in the Discover Tab.


For more, see Target Audience Settings Reference.

home_url

Object

The URL that will be displayed in the Messenger webview when someone opens your bot's Chat Extension.


For more, see Chat Extension Home URL Reference.

Retrieve Properties

Retrieves the current value of one or more Messenger Profile properties by name.

To retrieve Messenger Profile properties you must have the 'Moderator' role for the Page associated with the bot.

Request Parameters

The following parameters are included in the query string of the request:

ParameterDescription

fields

A comma-separated list of Messenger Profile properties to retrieve.

Example Request

curl -X GET "https://graph.facebook.com/v2.6/me/messenger_profile?fields=<PROPERTIES_LIST>&access_token=<PAGE_ACCESS_TOKEN>"

Example Response

The current value of the requested properties will be returned in the data array:

{
   "data": [
        {
          "whitelisted_domains": [
            "https://facebook.com/"
          ],
          "greeting": [
            {
               "locale": "default",
               "text": "Hello!"
            },
            {
               "locale": "en_US",
               "text": "Timeless apparel for the masses."
            }
         ]
      }
   ]
}

Set/Update Properties

Sets the values of one or more Messenger Profile properties. Only properties set in the request body will be overwritten.

To set or update Messenger Profile properties you must have the 'Administrator' role for the Page associated with the bot.

Example Request

curl -X POST -H "Content-Type: application/json" -d '{
  "<PROPERTY_NAME>": "<NEW_PROPERTY_VALUE>",
  "<PROPERTY_NAME>": "<NEW_PROPERTY_VALUE>",
  ...
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=<PAGE_ACCESS_TOKEN>"

Example Response

{
    "result": "success"
}

Delete Properties

Deletes one or more Messenger Profile properties. Only properties specified in the fields array will be deleted.

To delete Messenger Profile properties you must have the 'Administrator' role for the Page associated with the bot.

Example Request

curl -X DELETE -H "Content-Type: application/json" -d '{
  "fields": [
    "<PROPERTY_NAME>",
    "<PROPERTY_NAME>",
    "<PROPERTY_NAME>",
    ...
  ]
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=<PAGE_ACCESS_TOKEN>"

Example Response

{
    "result": "success"
}