Posts tagged with facebook-graph-api

need some help i'm trying to create an adset with cities in the targeting object but i'm getting an error

{     "error": {         "message": "Invalid parameter",         "type": "OAuthException",         "code": 100,         "error_data": "{\"blame_field\":\"targeting\"}",         "error_subcode": 1487756,         "is_transient": false,         "error_user_title": "Locations can't be used",         "error_user_msg": "Some of your locations overlap. Try removing a location.",         "fbtrace_id": "AApf6HmHZneXVFLD1U8BK-D"     } } 

steps to reproduce 1- create a campaign

curl -X POST https://graph.facebook.com/$API_VERSION/$ACCOUNT_ID/campaigns -F 'name=My Campaign' \    -F 'objective=OUTCOME_AWARENESS'\    -F 'status=PAUSED' \ -F 'special_ad_categories=[]'\    -F "access_token=$ACCESS_TOKEN" 

then, create an adset for this campaign

curl -X POST https://graph.facebook.com/v21.0/$MY_META_ACCOUNT_ID/adsets \   -F 'name=My Ad Set' \   -F 'campaign_id=6680088172618' \   -F 'daily_budget=1000' \   -F 'targeting={"geo_locations":{"countries":["US"],"cities":[{"key":2427178}]}}' \   -F "access_token=$MY_META_ACCESS_TOKEN" \ -F "billing_event=IMPRESSIONS" 

I'm encountering an issue with the Facebook Graph API where one of my users, User Chris, cannot list his Facebook pages despite being an administrator in Business Manager. Here's the breakdown:

Users:

User Hana

Access Token Permissions:

  • email
  • pages_show_list
  • ads_management
  • business_management
  • leads_retrieval
  • pages_read_engagement
  • pages_manage_metadata
  • pages_manage_ads
  • public_profile

Behavior: Successfully lists pages using GET https://graph.facebook.com/v17.0/me/accounts

User Chris

Access Token Permissions:

  • email
  • pages_show_list
  • ads_management
  • pages_read_engagement
  • pages_manage_metadata
  • pages_manage_ads
  • public_profile
  • Missing Permissions:
  • business_management
  • leads_retrieval

Behavior: Fails to list pages using GET https://graph.facebook.com/v17.0/me/accounts

Additional Context:

User Chris is an administrator in Business Manager, and his pages are managed through it. When User Hana was directly added as an administrator to a page outside of Business Manager, that page started appearing in her API results. Both users obtain their access tokens via the standard OAuth flow, and the application has been approved for the necessary permissions except for User Chris's token, which lacks business_management and leads_retrieval.

Steps Taken So Far:

  • Verified User Chris's role in Business Manager.
  • Ensured the application requests all necessary permissions during authentication.
  • Used the /debug_token endpoint to confirm User Chris's token permissions.
  • Attempted to re-authenticate User Chris to obtain a new token, but the missing permissions persist.

Question:

Is there a specific configuration or additional step required to ensure that administrators in Business Manager, like User Chris, have their access tokens include the business_management and leads_retrieval permissions?

I’m working with the Facebook Marketing API to analyze playable ads. While querying playable content, I only get access to two fields: "id" and "name"

I noticed that some SDKs (python) reference fields like source_url and source_zip. But even using that doesn't give me the source.

Here’s what I’ve done so far:

GET /v21.0/{ad_account_id}/adplayables ?fields=id,name,source_url,source_zip &access_token=<ACCESS_TOKEN> 

The above call only returns a list of playable assets with only the id and the name fields. No source fields

My Questions:

  1. Are the source_url and source_zip fields supported in the current API version?
  2. If not, is there any alternative way to retrieve the HTML source files for playable ads?
  3. Are there specific permissions or configurations required to access these fields, even as a page admin?

I implemented an android application and i am the administrator of a facebook group, i want to let my app's users post in my group using graph-api.

I created a business app in facebook developer console I used Graph API Explorer with v21.0 to post in the group using this endpoint: https://developers.facebook.com/docs/graph-api/reference/v21.0/group/feed#publish

In the requirements section, it's mentioned that publish_to_groups permission is required but with Graph API Explorer i can't find it in the list.

I tried with other permission: pages_show_list, pages_read_engagement and pages_manage_posts. But when i run this error is thrown:

(#200) If posting to a group, requires app being installed in the group, and \ either publish_to_groups permission with user token, or both pages_read_engagement \ and pages_manage_posts permission with page token; If posting to a page, \ requires both pages_read_engagement and pages_manage_posts as an admin with \ sufficient administrative permission

how can i achieve this requirement ?

update: Even when using a "Consumer"type app, the publish_to_groups permission is not listed.

I have a Facebook app with business verification completed. My app is a consumer app and has standard access to oEmbed read. My goal is to use the oEmbed Read feature. However, when I test its endpoints using the Graph API Explorer or Postman, I receive the following error:

(#10) To use 'oEmbed Read', your use of this endpoint must be reviewed and approved by Facebook. To submit this 'oEmbed Read' feature for review, please read our documentation on reviewable features: https://developers.facebook.com/docs/apps/review.

I used app id | client id as access token. Exp: 12346|879565654

I can't request advanced access of oEmbed Read because the button is disabled. For enable it I need to use the api and get 200, but it gets the error I provided above. I'm stuck because of this. Is someone know what should I do and give me steps? Or is this just a Facebook bug?

I tried sending request with Postman, with SDK and with Graph API explorer while app is in live mode and dev mode, but I still get the error provided above.