Posts tagged with facebook-webhooks

I'm working on a Facebook integration and need to retrieve comments from posts on any public Facebook Page (not just Pages I manage) using webhooks.

My app type is currently set to Consumer. I read that switching to Business might help, but I’m not sure if that alone will grant broader permissions.

1. What are the steps to follow to request access to public page comments for any Facebook Page?

  1. What app type should I create in the Facebook Developer Apps section, and which specific permissions should I request?

3.Can I convert my app type from Consumer to Business, and if I do, will that allow access to comments on any public Page?

4. How can I add a page to my app to receive comments via Webhooks for Pages I don’t manage?

What I’ve Tried:

  1. My app type is currently set to Consumer. I read that switching to Business might help, but I’m not sure if that alone will grant broader permissions.

  2. I’ve requested pages_read_engagement and pages_manage_engagement, but they only seem to work for Pages that the app or user manages.

  3. Looked into Public Content Access, but the guidelines are unclear on how to access comments specifically.

I am currently developing an app that interacts with Facebook Page content and messages using Facebook webhooks to receive event notifications when users engage with the page.

While I’ve successfully set up and received webhooks for most events, such as page messages and feed comments, I’m experiencing an issue where the webhook is not triggered when someone posts a comment that contains a video or GIF. It seems Facebook doesn’t send any event notifications when these types of media are included in the comment except PHOTO.

I’ve noticed other developers have reported similar issues in these threads, but there is no clear solution:

My goal: I need to capture comments that contain videos, GIFs, or stickers as soon as they are published. Actively polling for comments using the Graph API is not an ideal solution due to rate limits and the need for near real-time behavior.

Question: Has anyone found a solution or workaround for receiving these types of comments (with videos, GIFs, or stickers) in real-time using Facebook’s webhooks? Is there any other method to capture them efficiently without constantly querying the Graph API?

Any help or guidance would be greatly appreciated!

I'm developing an application to capture leads from a Facebook lead form. Here's what I've done so far:

  1. I created an App in the Facebook Developer Dashboard.
  2. I verified the webhook for this app, and the verification was successful.
  3. I have obtained advanced access for the following permissions: leads_retrieval, pages_show_list, pages_manage_metadata.
  4. I have enabled the User object and subscribed to leadgen events.
  5. I tested the webhook, and it's sending test leads in the response as expected.
  6. My app is in Live mode.

However, when a real lead is created on Facebook, I'm receiving the following response instead of the actual lead data:

{   "entry": [     {       "id": "0",       "time": 1724921046,       "changes": [         {           "field": "leadgen",           "value": {             "ad_id": "444444444",             "form_id": "444444444444",             "leadgen_id": "444444444444",             "created_time": 1724921046,             "page_id": "444444444444",             "adgroup_id": "44444444444"           }         }       ]     }   ],   "object": "page" } 

What could I be doing wrong, and how can I start receiving real lead data instead of this mock response?

this is screen shot of my app:- App details:- Permission Details:- Webhook Details:-

I would like to call for suggestions regarding a challenge I've been trying to solve recently involving Meta API & Webhooks. I assume this particular setting has not been addressed here before.

As one may know, to configure receiving requests from WhatsApp, Facebook, and Instagram for a Meta app you need setting up a webhook for each in the respective parts of Meta dev dashboard. This involves allowing webhooks required app-level subscriptions/permissions and providing an endpoint that you confirm by returning a verify token on a GET request to ensure it's ok to send you requests there.

In my case, I would like other people to use the app as well, so I added oath2 to get necessary permissions for user business pages on Wa, Fb or Instagram, which works well.

After that, with necessary access, you can add your or someone's page to a pre-configured webhook, so it starts accepting requests. This action can be done through a dashboard in the menu that looks similar to this depending on the platform.

On the other hand, this can be done with sending a request, specifying webhook subscription fields yourself (such as messages on the picture above).

POST /v20.0/{app-id}/subscriptions HTTP/1.1

However, this feature is only available for Facebook pages and in the request-dedicated article we can see it mentioned. Any other webhook-related requests actually allowed for WhatsApp and Instagram are only for adding a webhook to an app (the very first step described here).

Limitations:

Webhooks for Instagram is not supported. Instagram webhooks must be configured using the App Dashboard. Webhooks for WhatsApp is not supported. WhatsApp webhooks must be configured using the App Dashboard. https://developers.facebook.com/docs/graph-api/reference/v20.0/app/subscriptions

And given that, one needs to do it through dev dashboard UI which is not an acceptable solution in my case.

Therefore, I can really use some insights on how can this be solved directly or through some witty alternative to receive messages from all three platforms and being able to programmatically allow webhook page requests.

Additionally, I have been considering raising the issue with Meta directly, so it can be adjusted and would love to hear thoughts on potentially doing this.

P.S.

For those deeply interested in the issue, I found some sort of similar issue on the meta dev forum https://developers.facebook.com/community/threads/799110895741478/

I created a small script to handle all webhooks from Facebook feed. The goal is to detect when a page goes live and get all comments from that live video. So far, everything is working well: I receive all the necessary information, including comments with the from ID and from Name.

However, I've encountered an issue where the from ID doesn't seem to be correct. If I try to navigate to facebook.com/FROM_ID, I get an error. After fetching some data and comparing it against known user IDs, I noticed they don't match at all. I wonder if this is normal, a bug, or some kind of encryption.

Issue The from ID received in the webhook payload seems incorrect.

Here is an example of the payload I'm receiving:

Array (     [entry] => Array         (             [0] => Array                 (                     [id] => 1xxxxxxxxxxxxxx                     [time] => 1716213862                     [changes] => Array                         (                             [0] => Array                                 (                                     [value] => Array                                         (                                            ** [from] => Array                                                 (                                                     [id] => 1xxxxxxxxxxxxxx                                                     [name] => User Name                                                 )**                                             [post] => Array                                                 (                                                     [status_type] => added_video                                                     [is_published] => 1                                                     [updated_time] => 2024-05-20T14:04:16+0000                                                     [permalink_url] => https://www.facebook.com/MYPAGE/                                                     [id] => 1xxxxxxxxxxxxxx_1xxxxxxxxxxxxxx                                                 )                                             [message] => Some Random Message                                             [post_id] => 1xxxxxxxxxxxxxx_1xxxxxxxxxxxxxx                                             [comment_id] => 1xxxxxxxxxxxxxx_1xxxxxxxxxxxxxx                                             [created_time] => 1716213856                                             [item] => comment                                             [parent_id] => 1xxxxxxxxxxxxxx_1xxxxxxxxxxxxxx                                             [verb] => add                                         )                                     [field] => feed                                 )                         )                 )         )     [object] => page ) 

Questions

  • Is it normal for the from ID in webhook events to not match the expected user ID format?
  • Is there any encryption or obfuscation applied to the from ID?
  • Has anyone else faced this issue, and how did you resolve it?

Additional Information

Thank you!

Graph API Requests: I tried using the Graph API with the from ID to fetch basic user information but received errors.

Searching for Similar Issues: I searched extensively for similar issues related to Facebook webhooks but couldn’t find any relevant solutions.