Posts under category Facebook Graph API

I've encountered a problem with my application in Live mode. I've conducted several tests with various Facebook pages and Instagram accounts, always following the same process, but I'm getting inconsistent permissions.

I use facebook api v20.

Problem Details

  • In most cases, I successfully obtain all the required permissions.
  • In some instances, I can't get the pages_show_list permission.
  • The error occurs only with certain accounts, but I can't identify what distinguishes these accounts from the others.

Current Implementation

I'm requesting the following permissions:

  • instagram_basic
  • instagram_manage_insights
  • business_management
  • pages_show_list
  • pages_read_engagement

All permissions are successfully approved by facebook.

I use the following URL for authentication:

const url = `https://www.facebook.com/dialog/oauth?client_id=${CONFIG.FACEBOOK_APP_ID}&extras={"setup":{"channel":"IG_API_ONBOARDING"}}&redirect_uri=${CONFIG.BACKOFFICE_URL}/instagram&response_type=token&scope=instagram_basic,instagram_manage_insights,business_management,pages_show_list,pages_read_engagement` 

Encountered Error

When testing the user-generated accessToken in the Facebook API Graph Tester, I receive the following error, but only for some accounts:

"The "accounts" field is only accessible on the User object after the user has granted one of the following permissions: 'pages_show_list'." 

Questions

  1. How is it possible that this inconsistency in permissions occurs?
  2. Could it depend on some specific configuration of the Facebook page in question?
  3. What might be distinguishing the accounts that encounter this error from those that don't?
  4. Are there alternative solutions or approaches to ensure consistent obtaining of all required permissions?

Any help or suggestions to understand and resolve this issue would be greatly appreciated. Thank you in advance for your support.

Actually continuously Facebook rejected our app due to this reason and I don't have any idea what points are missing and what I want to add to the privacy policy & I put a link to the privacy policy on the settings and login screen already then also they rejecting so if anyone has any suggestion and any supported tool to create a privacy policy without violation please help me.

This response comes from Meta,


I am attaching my privacy policy content here,

Thanks in advance.

I created an app which uss facebook API for post and read content from facebook pages. App was recently approved, I can go live. Everything worked in test regime with test accounts, but when I started testing it live with real accounts I have en errors I cannot explain.

  1. I removed permission role as admin/tester from my fake test account, to test it as external. I can login with it and get page data. I can post on behalf of this user. But for some reason I cannot get feed. I receive an error, that I miss pages_read_engagement permission, but in my business app stated, that this permission is granted and active. And when I login, this permission is on the list, that I grant app with this data. I wrote already letter to facebook direct support, but didn't receive any reply yet. Any ideas?

  2. When I try to login with my personal facebook account, I can, I get user data, but I cannot get any pages data. Array with pages is returned empty. I do have pages_show_list permission. In this case there is no error calling this api, but why I cannot see any pages?

I will appreciate any advice

curl -G \   -d "fields=campaign_name,adset_id,adset_name,impressions,clicks,cpc,spend,date_start,date_stop" \   -d "time_range={'since':'2023-07-01','until':'2023-09-30'}" \   -d "access_token=${FACEBOOK_ACCESS_TOKEN}" \   https://graph.facebook.com/v21.0/act_"$FACEBOOK_ACCOUNT_ID"/insights 

Returns

{   "data": [     {       "impressions": "*******",       "clicks": "*****",       "cpc": "*****",       "spend": "**********",       "date_start": "2023-09-25",       "date_stop": "2023-09-30"     }   ],   "paging": {     "cursors": {       "before": "****",       "after": "****"     }   } } 

Why is it not returning the other fields like campaign_name, adset_id etc?? I'm getting the field names from here: https://github.com/facebook/facebook-php-business-sdk/blob/7ec7292c1ce3c78e2005d730da0092e28458af95/src/FacebookAds/Object/Fields/AdsInsightsFields.php#L46