Communication
Facebook Messenger Webhooks
Meta Messenger Platform webhooks. Receive messages sent to your Facebook Page, postbacks from buttons and Get Started, deliveries, reads, reactions, opt-ins, referrals and Handover Protocol events.
Connecting Facebook Messenger to Hookbase
Create a source in Hookbase first — it gives you an ingest URL to paste into Facebook Messenger. Then:
- 1In the Meta App Dashboard, open App settings → Basic, copy the App secret (click Show) and paste it into this Hookbase source
- 2Go to Messenger → Settings (or Messenger API Setup → Configure webhooks), enter your Hookbase ingest URL as the Callback URL and the Verify token Hookbase generated, then verify and save. Hookbase answers Meta's check itself
- 3Connect your Page and add subscriptions for the fields you need (e.g. messages, messaging_postbacks), or call POST /{page-id}/subscribed_apps?subscribed_fields=messages with a Page access token
- 4Until the app has Advanced Access (App Review), Meta only delivers events from people with a role on the app
- 5Meta expects a 200 within 5 seconds, and after an hour of failed deliveries it unsubscribes the app from the Page, which must then be resubscribed by hand
Signature verification
Set the source's provider to whatsapp and paste the signing secret. Every request is checked before the event is stored, and anything that fails is rejected rather than quietly recorded.
- Algorithm
- HMAC-SHA256
- Header
- X-Hub-Signature-256
- Where to find the secret
- Meta App Dashboard → Your App → App settings → Basic → App secret (click Show). The Callback URL and Verify token go under Messenger → Settings (or Messenger API Setup → Configure webhooks).
Facebook Messenger event types
13 of the events people route most often. Hookbase accepts every event Facebook Messenger sends, whether or not it is listed here.
messages
A person sent your Page a message
message_echoes
Your Page sent a message
messaging_postbacks
A postback button, Get Started button or persistent-menu item was tapped
message_deliveries
Messages your Page sent were delivered
message_reads
The person read messages your Page sent
message_reactions
The person reacted to, or removed a reaction from, a message
message_edits
The person edited a message
messaging_optins
The person opted in (plugin, checkbox or marketing messages)
messaging_referrals
The person re-entered an existing thread from an m.me link or an ad
messaging_handovers
Handover Protocol: thread control passed, taken or requested
standby
An event for a thread your app does not currently own
messaging_account_linking
The person linked or unlinked their account
messaging_policy_enforcement
Meta warned, blocked or unblocked your Page for a policy violation
What a Facebook Messenger webhook looks like
A messages payload. Hookbase stores the raw body exactly as it arrived, so this is also what you get back on a replay.
{
"object": "page",
"entry": [
{
"id": "PAGE_ID",
"time": 1458692752478,
"messaging": [
{
"sender": {
"id": "PSID"
},
"recipient": {
"id": "PAGE_ID"
},
"timestamp": 1458692752478,
"message": {
"mid": "mid.1457764197618:41d102a3e1ae206a38",
"text": "hello, world!"
}
}
]
}
]
}Start receiving Facebook Messenger webhooks
Create a source, paste the URL into Facebook Messenger, and watch the first event arrive. The free tier includes 1,000 events a month.
Get Started Free