Chat Extension Home URL
This field allows your bot to enable a Chat Extension in the composer drawer in Messenger. It controls what the user sees when your bot's chat extension is invoked via the composer drawer in Messenger.
The URL specified here is for Chat Extensions only. The webapp at the URL you specify should use the APIs available in the webview to implement useful functionality for your bot's users.
This field is not a place to put your bot or company's homepage.
To set it, call the Messenger Profile API with the home_url field:
Contents
Setting the Home URL
The domain of the URL you specify here should be whitelisted for it to work correctly.
curl -X POST -H "Content-Type: application/json" -d '{
"home_url" : {
"url": "http://petershats.com/send-a-hat",
"webview_height_ratio": "tall",
"in_test":true
}
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=YOUR_ACCESS_TOKEN_HERE"
Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
| The URL to be invoked from drawer. Must be whitelisted. The URL must be on https. We don't support non-https protocol. | String | Yes |
| Controls the height of webview. Only allowed value is | String | Yes |
| Controls whether the share button in the webview is enabled. Either | String | No |
| Controls whether public users (not assigned to the bot or its Facebook page) can see the Chat Extension. This should be set to | Boolean | Yes |
Response
If your home URL was set successfully, you will get back the following response:
{
"result":"success"
} Reading the Home URL
In order to get the home URL you set previously, send a GET request:
curl -X GET "https://graph.facebook.com/v2.6/me/messenger_profile?fields=home_url&access_token=PAGE_ACCESS_TOKEN"
Deleting the Home URL
In order to remove the Home URL from your bot (and thus Chat Extension capabilities), send a DELETE request:
curl -X DELETE -H "Content-Type: application/json" -d '{
"fields":[
"home_url"
]
}' "https://graph.facebook.com/v2.6/me/messenger_profile?access_token=PAGE_ACCESS_TOKEN" Once deleted, the bot will not be visible in the list shown to Messenger users in the composer.
Conditions to show your bot in composer drawer
Your bot is going to appear in drawer once user clicks get started button or opens a webview (in 1:1 thread or in a group thread) that has Messenger extension enabled and home_url is set for that bot.
If user deletes or blocks a bot then bot will be out from the drawer.
User will see a red dot (badge near composer + icon) when bot appears in drawer.
- We move good quality chat extension bots to featured list and it's going to appear in user's drawer (even though user has never interacted with the bot.) You don't need to worry about this we regularly update this list.