Posts tagged with facebook-opengraph

I'm trying to create an ad account in my Facebook Business with this API endpoint:

https://developers.facebook.com/docs/marketing-api/reference/ad-account/

I'm using these parameters for my API call:

{   "name": "Graph API Test 123",   "currency": "EUR",   "timezone_id": "42",   "end_advertiser": "{my_business_id}",   "media_agency": "{my_fb_app_id}",   "partner": "NONE",   "funding_id": "{my_funding_id}" } 

According to the docs, a POST endpoint is available and valid.

When removing the funding ID from my request it works. I've checked if the payment method behind the funding ID is active and valid and it is. It's assigned to other ad accounts as well and I'm spending money with it.

Does anyone know why this happens? I'm pretty sure it used to work in the past.

My website uses FacebookClient to get the company's Facebook feed and display the latest posts on the site. It's no longer working (not sure how long ago it stopped). The access token expired a while ago, so I updated the access token, and the access token now works (I don't get an exception now on dynamic feedData = (IDictionary<string, object>)client.Get($"{pageId}/feed", new Dictionary<string, object> { { "limit", numResults } }); but it just returns an empty array.

I know that the pageId and accessToken are valid, because this code works:

dynamic coverImage = client.Get(pageId, new Dictionary<string, object> {     { "fields","picture" } }); 

but the call to get the feed returns no posts.

To make testing easier, I'm testing in https://developers.facebook.com/tools/explorer?method=GET&path={pageId}%2Ffeed&version=v20.0. I get the same results in the explorer. No error, just an empty data array:

{   "data": [   ] } 

I verified there are posts on the Facebook page as recent as 4 hours ago. If the access token and pageId are valid, why is {pageId}/feed returing no data?

I am trying to send items to commerce catalog using V20 Graph API andI continue to get this error.

"error_user_msg": "Products without \"link\" information can't be uploaded. Please check that this field is included for each product in a separate, labelled column.",

All fields appear to be valid, I just can't get past this error here.

I have tried with API and directly with Graph API Post, both return the same error.

var postData = {     "retailer_id": "TEST_SKU_12345",  // Using a static SKU for testing     "name": "Test Product",     "price": 100,  // Using an integer value for the price     "currency": "USD",  // Default to USD     "link": encodeURIComponent("https://store.casablancawirelessllc.com/g-power-5g?sku=PQPWFV"),  // URL-encoded link     "image_url": "https://b3213372.smushcdn.com/3213372/wp-content/uploads/2023/07/stacks-dark-1.png" // Valid image URL   }; 

I have created this code to fetch leads from Facebook:

import pandas as pd from facebook_business.api import FacebookAdsApi from facebook_business.adobjects.adaccount import AdAccount from facebook_business.adobjects.ad import Ad from facebook_business.adobjects.user import User from facebook_business.adobjects.lead import Lead import requests from datetime import datetime import time # Permanent Access Token access_token = "my_token" facebook_api = FacebookAdsApi.init(access_token=access_token) start_date = '2023-07-01'  end_date = '2023-07-31'  account_id = "my_ad_account_id" lead_fields = ['campaign_name',"created_time","field_data"] lead_params = {                 'filtering': [{'field': 'time_created', 'operator': 'GREATER_THAN', 'value': start_date},                               {'field': 'time_created', 'operator': 'LESS_THAN', 'value': end_date}                              ]               } leads_list = [] # Getting ads ad_account = AdAccount(account_id) ads = ad_account.get_ads() for ad in ads:   leads = ad.get_leads(fields=lead_fields,params=lead_params)   for lead in leads:     lead_dic = {}     lead_dic["campaign_name"] = lead["campaign_name"]     lead_dic["created_time"] = lead["created_time"]     field_data = lead["field_data"]     for field in field_data:       lead_dic[field["name"]] = field["values"][0]     leads_list.append(lead_dic) print(leads_list) 

It works for my test account that has few ads, but I get an limit error when I try to use it with my main account.

I figure that I should use batch request, but I could not make it work. Can someone please help to to adapt this code so it does not get limit errors?

a few months ago I requested the corresponding permissions in my app V.18.0: pages_messaging, public_profile, pages_manage_metadata, pages_read_engagement, pages_show_list, and business_management. All permissions were granted. However, when trying to make the connection, no pages appeared for me to connect to; it showed 'list is empty'. So, I updated my app to V.20.0. Now, if there is one page, I can establish the connection, but if there are 2 or more pages, it still shows as 'list is empty'. Do you have any advice on how to solve this? I've checked permissions settings for the pages and the app, but I can't identify the issue.

I expected all the Facebook pages I have to appear in my app so that I could select one or all of them and receive their Messenger messages in my application. I tried upgrading from version 18.0 to version 20.0, but it still doesn't work.