Posts tagged with facebook-marketing-api

i want to give partner access of business assets to someone via Facebook api, but i have no idea how it can be done.

I tried to use page-id/assigned_users API to assign a page to the user but that also didn't worked, sometimes i got the error, that app-scoped id is invalid and other time i got error: "there is not business linked with this id".

I did some research over chatgpt, and what i got to know is, firstly i need to add the user to business manager and only then i can use above api. But i am not sure if the chatgpt answer is reliable or not.

I have read facebook documentation, but its very confusing !!!

I am new to facebook graph api, so any small help will be really appreciated.

i am trying to add a business manager to the partner account for another business page via facebook api, i have tried several apis, but failed. I want to grant access to facebook page.

Below are some of the apis i used in postman:

https://graph.facebook.com/v17.0/page-id/assigned_users?user=TO_WHOM_PERMISSION__WILL_BE_GRANTED&business=PAGE_BUSINESS_ID&access_token=TOKEN_OF_PAGE_OWNER&tasks[]=MANAGE https://graph.facebook.com/v17.0/BUSINESS_MANAGER_ID/owned_pages https://graph.facebook.com/v21.0/BUSINESS_MANAGER_ID/managed_businesses?existing_client_business_id=BUSINESS_ID&access_token=TOKEN_OF_OWNER 

But nothing worked, My main motive is to give access of facebook page to some other business manager by adding him to partner account, Do anyone have any idea how it can be done via api, any small help will be really appreciated, thanks in advance !!!

I'm encountering an issue with the Facebook Graph API where the responses do not respect the specified date ranges in my queries. Here are the details of my requests and the responses I receive:

Query using time_range:

/campaigns?level=campaign&fields=account_id,effective_status,id,name,insights{reach,dda_results,frequency,cost_per_conversion,spend,impressions,cpm,clicks,cost_per_unique_click,purchase_roas,actions,action_values},lifetime_budget,start_time&limit=1&time_increment=1&time_range={'since':'2024-09-07','until':'2024-09-08'} 

Response:

"insights": {     "reach": "372827",     "date_start": "2024-08-12",     "date_stop": "2024-09-10" } 

Query using date_preset=yesterday:

/campaigns?date_preset=yesterday&level=campaign&fields=account_id,effective_status,id,name,insights{reach,dda_results,frequency,cost_per_conversion,spend,impressions,cpm,clicks,cost_per_unique_click,purchase_roas,actions,action_values},lifetime_budget,start_time&limit=1&time_increment=1 

Response:

"insights": {     "reach": "372827",     "date_start": "2024-08-12",     "date_stop": "2024-09-10" } 

Despite specifying narrow date ranges, the API returns data spanning almost a month. Has anyone else faced this issue, or can provide insights on how to enforce the specified date range in the query?

I’m facing an issue where the Facebook Graph API is not returning lead data for a specific ad, even though the leads are visible in the Ads Manager.

Here’s what I’ve done: I’m using the following endpoint to retrieve the leads: GET /{ad_id}/leads?fields=id,created_time,field_data&limit=1000

The leads for other ads are returned correctly, but for one particular ad ("ad1 - Copy"), no leads are returned, even though I can clearly see them in the Facebook Ads Manager (65 leads in total). I’ve made sure that my access token has the required permissions: leads_retrieval ads_read ads_management pages_manage_ads I’ve also tried adding parameters like date_preset=maximum, but this doesn't help with retrieving the missing leads. I've checked Stack Overflow and the Facebook Developer forums, but I haven't found a solution specific to this issue. Has anyone encountered a similar issue, and is there a known fix or workaround for this discrepancy between the Ads Manager and the API? Any help or guidance would be greatly appreciated!

Environment: API version: v20.0 Access token permissions: leads_retrieval, ads_read, ads_management What I’ve Tried: Refreshing the token and regenerating it with proper permissions. Adding various query parameters (like limit and date_preset). Expected Behavior: The API should return all leads for "ad1 - Copy" just like it does for other ads.