Skip to main content

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.

  • from and apiKey are 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 same from and apiKey.
  • The instagram_… fields are sent only for facebook_type 2 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:

SettingValue
URLYour URL — set it with Set Webhook
MethodJSON 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​

ParameterDescription / Example
status"OK" always.
event"facebook" always.
facebook_typeThe type that was onboarded. See the values below.
facebook_type_nameThe same as facebook_type, in text.
facebook_referenceThe reference value that was provided by you when creating the onboarding link. Empty when you didn't provide one.
fromThe ID we generate for you, that comes together with the apiKey in order to send outgoing messages. It contains 15 digits.
apiKeyThe apiKey for the service — this is how you initiate outgoing messages and data with our Facebook API, together with from.
serverThe Online server, if provided when creating the onboarding link. Empty otherwise.
account_idThe Online account id, if provided when creating the onboarding link. 0 otherwise.
inbox_idThe Online inbox id, if provided when creating the onboarding link. 0 otherwise.
business_idThe id of the client's business on Facebook (Meta Business Portfolio). Empty when it isn't available.
business_nameThe name of the client's business on Facebook (Meta Business Portfolio). Empty when it isn't available.
page_idThe 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_nameThe Facebook page name (of that page_id).
page_categoryThe category of the page.
page_linkThe Facebook page link URL.
page_aboutThe Facebook page about information.
page_fan_countThe number of fans (followers) of the Facebook page at the onboarding time.
page_pictureThe profile picture of the Facebook page.
admin_nameThe 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_emailThe Facebook page admin email address — of the same admin as admin_name. Empty when Facebook doesn't provide it.
instagram_idThe Instagram page id. Sent only for facebook_type 2 or 4.
instagram_usernameThe Instagram username, without @. Sent only for facebook_type 2 or 4.
instagram_nameThe Instagram page name. Sent only for facebook_type 2 or 4.
instagram_profile_pictureThe Instagram page profile picture. Sent only for facebook_type 2 or 4.
instagram_followers_countThe Instagram page total followers count at the onboarding time. Sent only for facebook_type 2 or 4.
instagram_media_countTotal media uploaded to the Instagram page (total posts). Sent only for facebook_type 2 or 4.
instagram_biographyThe biography written on the Instagram page. Sent only for facebook_type 2 or 4.
instagram_websiteThe website provided on the Instagram page. Sent only for facebook_type 2 or 4.

facebook_type​

ValueExplanation
1Facebook Messenger.
2Instagram Messenger.
3Facebook Page (posts and comments).
4Instagram Page (posts and comments).

Webhook payload

​

Your response​

Received. Answer with a 2xx status (200 OK) within 10 seconds, and process the webhook afterwards. The body of your answer is ignored.