Posts tagged with facebook-graph-api

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?

I want to create an ad creative with the Meta/Facebook Marketing API. The goal is to create an ad creative which I can turn into an ad which has multiple images and primary texts and titles.

As shown in the picture, I want to have the same image in "Feeds, In-Stream Ads for Videos and Reels, Search Results" and "Right Hand, Search Results". I want a different image in "Stories and Reels, Apps and Websites".

Additionally, I want to specify multiple primary texts and multiple titles.

I tried to create the creative using this:

{     "object_story_spec": {       "page_id": "PAGE_ID"     },     "asset_feed_spec": {       "images": [         {           "hash": "HASH1",           "adlabels": [{"name": "label_feed"}]         },         {           "hash": "HASH2",           "adlabels": [{"name": "label_story"}]         }       ],       "bodies": [         {           "text": "Begin Your Adventure"         }       ],       "titles": [         {           "text": "Level Up"         },         {           "text": "Level Up 2"         }       ],       "call_to_action_types": [         "SHOP_NOW"       ],       "link_urls": [         {           "website_url": "https://www.example.com/"         }       ],       "ad_formats": [         "SINGLE_IMAGE"       ],       "asset_customization_rules": [         {           "customization_spec": {             "publisher_platforms": [               "facebook"             ],             "facebook_positions": [               "feed"             ]           },           "image_label": {             "name": "label_feed"           }         },         {           "customization_spec": {             "publisher_platforms": [               "instagram"             ],             "instagram_positions": [               "story"             ]           },           "image_label": {             "name": "label_story"           }         }       ]       },   "status": "PAUSED",   "degrees_of_freedom_spec": {         "creative_features_spec": {             "standard_enhancements": {                 "enroll_status": "OPT_OUT"             }         }     } } 

However, it gives me an error:

Multiple title elements cannot be applied to rule #1 (Priority, if specified, or index of the rule) in the Ad Asset Feed.

Additionally, it seems like I have to specify adlabels in the asset story spec. How can I place the images in the categories without the adlabels?

I am having trouble obtaining the pages_read_engagement and pages_show_list and ... permissions for my Facebook app. I just created the app and selected the Facebook Login type, but the only permissions available in the use cases are email and user_profile.

I want to create an app that can automatically reply to comments with direct messages, so I need the following permissions:

  • pages_show_list

  • pages_read_engagement
    and ...

Here are the steps I have taken so far:

  1. Created a new Facebook app.

  2. Selected "Facebook Login" as the type.

  3. Tried to configure permissions but only saw options for email and user_profile.

How can I add the necessary permissions for my app? Is there a specific process or additional steps I need to follow to request these permissions?

Any help or guidance would be appreciated.

We are trying to give an option to the user to request there partners to share their assets access like ad account to requested business account. we are using this api to process this flow

curl -i -X POST \ "https://graph.facebook.com/v18.0/<businessid>/client_ad_accounts?adaccount_id=act_123&permitted_tasks=%5B%0A%20%20%22MANAGE%22%0A%5D&access_token=User Access Token" 

Note: I will provide the details for above in confidential reply.

we have checked the access token we have the required permission like business_manager as per the api document https://developers.facebook.com/docs/marketing-api/business-asset-management/guides/business-to-business But we keep getting this error (Application does not have the capability to make this api call.).

Please suggestion if anything we are missing or any special permission required for this api call. However when we try the same process with pages then it works fine.

Your help is highly appreciated. Thanks!!

I have tried above Curl , I am expecting access sharing should be working as per the facebook api