Event: Facebook
Webhook
For every Facebook event, you will get a webhook (event "facebook"). It is sent once, when your client completes the onboarding of a link you created with Create onboarding Link — see Start Here!. facebook_type is the type that was onboarded.
fromandapiKeyare the credentials to send outgoing messages and data of this connection with our Facebook API. If the same Facebook page or Instagram account is onboarded again with the same type, you get the samefromandapiKey.- The
instagram_…fields are sent only forfacebook_type2 or 4. - The page, Instagram and admin details are as they were at the onboarding time. A detail that Facebook didn't provide is empty (or 0).
Settings:
| Setting | Value |
|---|---|
| URL | Your URL — set it with Set Webhook |
| Method | JSON via POST |
With every Facebook event, you will get some of the following:
{
"status": "OK",
"event": "facebook",
"facebook_type": 2,
"facebook_type_name": "Instagram Messenger",
"facebook_reference": "my-reference",
"from": "623748845667358",
"apiKey": "5e2b8d-a1c4f7-09d3e6-b8f2a5-c7e1d4",
"server": "online.99digital.co.il",
"account_id": 1,
"inbox_id": 2,
"business_id": "184736291045832",
"business_name": "My Flowers Business Ltd",
"page_id": "123637468573457",
"page_name": "My Flowers Business",
"page_category": "Retail Company",
"page_link": "https://www.facebook.com/123637468573457",
"page_about": "Fresh flowers, delivered every day",
"page_fan_count": 400,
"page_picture": "https://www.example.com/images/page-picture.jpg",
"admin_name": "George Levi",
"admin_email": "george@example.com",
"instagram_id": "17841463464574680",
"instagram_username": "george_flowers",
"instagram_name": "My Flowers Business",
"instagram_profile_picture": "https://www.example.com/images/instagram-profile.jpg",
"instagram_followers_count": 530,
"instagram_media_count": 54,
"instagram_biography": "This is my flowers shop",
"instagram_website": "https://www.flowersshop.example.com"
}
Response explained
| Parameter | Description / Example |
|---|---|
status | "OK" always. |
event | "facebook" always. |
facebook_type | The type that was onboarded. See the values below. |
facebook_type_name | The same as facebook_type, in text. |
facebook_reference | The reference value that was provided by you when creating the onboarding link. Empty when you didn't provide one. |
from | The ID we generate for you, that comes together with the apiKey in order to send outgoing messages. It contains 15 digits. |
apiKey | The apiKey for the service — this is how you initiate outgoing messages and data with our Facebook API, together with from. |
server | The Online server, if provided when creating the onboarding link. Empty otherwise. |
account_id | The Online account id, if provided when creating the onboarding link. 0 otherwise. |
inbox_id | The Online inbox id, if provided when creating the onboarding link. 0 otherwise. |
business_id | The id of the client's business on Facebook (Meta Business Portfolio). Empty when it isn't available. |
business_name | The name of the client's business on Facebook (Meta Business Portfolio). Empty when it isn't available. |
page_id | The page id of the Facebook account (relevant for all 4 types of onboarding). Even when you connect an Instagram account only, there is still a Facebook page id, since an Instagram account is always connected to a Facebook page. |
page_name | The Facebook page name (of that page_id). |
page_category | The category of the page. |
page_link | The Facebook page link URL. |
page_about | The Facebook page about information. |
page_fan_count | The number of fans (followers) of the Facebook page at the onboarding time. |
page_picture | The profile picture of the Facebook page. |
admin_name | The Facebook page admin name — the admin of the client's business on Facebook when it is available, otherwise the Facebook user who completed the onboarding. |
admin_email | The Facebook page admin email address — of the same admin as admin_name. Empty when Facebook doesn't provide it. |
instagram_id | The Instagram page id. Sent only for facebook_type 2 or 4. |
instagram_username | The Instagram username, without @. Sent only for facebook_type 2 or 4. |
instagram_name | The Instagram page name. Sent only for facebook_type 2 or 4. |
instagram_profile_picture | The Instagram page profile picture. Sent only for facebook_type 2 or 4. |
instagram_followers_count | The Instagram page total followers count at the onboarding time. Sent only for facebook_type 2 or 4. |
instagram_media_count | Total media uploaded to the Instagram page (total posts). Sent only for facebook_type 2 or 4. |
instagram_biography | The biography written on the Instagram page. Sent only for facebook_type 2 or 4. |
instagram_website | The website provided on the Instagram page. Sent only for facebook_type 2 or 4. |
facebook_type
| Value | Explanation |
|---|---|
| 1 | Facebook Messenger. |
| 2 | Instagram Messenger. |
| 3 | Facebook Page (posts and comments). |
| 4 | Instagram Page (posts and comments). |
Webhook payload
Your response
- 200
- default
Received. Answer with a 2xx status (200 OK) within 10 seconds, and process the webhook afterwards. The body of your answer is ignored.
Any other answer, or no answer in time, is a failed delivery. There are no retries: a webhook that was not delivered is not sent again.