Posts under category facebook-graph-api

Since there is no official support of the Graph API in Python, and I don't want to use unofficial libraries, can someone tell me how to write the code to use it in Python?

I tried to search for ways to write code in Python but the results I'm getting are unofficial libraries. I'll have to write the code manually.

I am trying to set up an Instagram Graph API integration.

The problem in short: when trying to query the GET /me/accounts endpoint, i get an empty data list (pages list). And that makes me unable to continue with data fetching (beacuse I need his instagram user id).

Details:

  • My instagram app is not live yet, still in development (yet to go through app review process)
  • Im trying to do it with an access token of a friend (for my account it works). I think I completed all the prerequisites for that to be possible: added his developer account as a developer in my app, he connected the instagram account to the facebook page, i got the access token with the following permissions: instagram_basic,pages_show_list,pages_read_engagement,instagram_manage_insights
  • The same flow works for my account
  • The same result received when using the Graph API Explorer
  • Im basically trying to set up with those two guides (tried both ways, still empty list): https://developers.facebook.com/docs/instagram-api/getting-started and https://developers.facebook.com/docs/instagram/business-login-for-instagram

I'm trying to update my Lead Values using the API. I only use server side to send first party data, the thing is that I need to readjust the values of these leads the first days / weeks, and there isn't any mechanism that I see to do so.

The only most logical way would be to send same events with same event_id and Facebook deduplicates or updates the event to the most recent one. But the documentation states the following:

"Does not deduplicate events when only using one event source, that is browser-only or server-only. If you send us two consecutive browser events with the same information, we do not discard either. If you send us two consecutive server events with the same information, we do not discard either."

Would be there any way to delete / update events with more fresh data? Don't want to send my Leads with a lot of delay of the time event.

I'm sending events with the first value I have on my BD, but it is not 100% accurate over time.

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.

Working on a product for posting content on user's facebook pages and managing their product catalogs/ad accounts via API calls. As far as I understand, in order to manage client assets from my app, I need to have an On Behalf Of relationship between my business account and the client's business account. This however seems impossible, considering that their own documentation mentions edges that do not exist anymore (specifically /{business_id}/managed_businesses).

I tried using user access tokens from Facebook Login directly but that doesn't seem to work, and have been looking at documentation which seems to be outdated and not accurate anymore.

My question is: has anyone managed to set this up recently? What am I missing?