facebook-webhooks

Webhook for hosted event?


I have a webhook subscribed to Page feed events.

I want it to tell me when a public event has been created on the page OR a page the user manages.

The app dashboard tells me this is the JSON object that will get sent to me:

{
 "field": "feed",
 "value": {
  "item": "status",
  "post_id": "44444444_444444444",
  "verb": "add",
  "published": 1,
  "created_time": 1536110879,
  "message": "Example post content.",
  "from": {
      "name": "Test Page",
      "id": "1067280970047460"
  }
 }
}

Is the event id delivered in the post_id field?

If not, how is it passed to me?

How can I test this further?

Is my only choice to create events by hand, record the event id and fill it in as the returned post_id?

Can this webhook receive notification from multiple user's pages?

If so, how do I configure it to do so?

If not, how do I do something like that? Do I need multiple webhooks?


Solution

  • As per relevant webhooks doc reference https://developers.facebook.com/docs/graph-api/webhooks/reference/page/#feed

    1. event_id is not delivered in the post_id.
    2. event_id is passed inside value as event_id, you may need to check you app, seems like event_id is being filtered out in the response.
    3. Testing it further is a broad query, although you could use curl to perform testing with the configured FB account.
    4. In a more generic context, the above webhook response can be used to autogenerate/handle the post, that is the core purpose of the existence of the webhooks(to trigger and automate events as and when occurred).
    5. No, this webhook is page specific.
    6. You need to configure the webhook for each page separately. (Find the page_ids that can be used to work with other pages corresponding to the user)
    7. The same webhook shall work, although the only difference shall be the page parameter, so you would have to configure another set of webhooks for each page, with a unique page_id related to that user account.

    Note: Refer to https://developers.facebook.com/docs/graph-api/webhooks/getting-started for testing the webhooks.