我正在尝试使用Facebook Marketing API和Facebook Python Business SDK创建自动 Facebook 广告。到目前为止,我成功地发布了新的活动和广告集,但是当我尝试创建广告创意时,它返回消息“应用程序没有能力进行此 API 调用。”。
Message: Call was not successful
Method: POST
Path: https://graph.facebook.com/v3.0/act_xxxxxx/adcreatives
Params: //XXX
Status: 400
Response:
{
"error": {
"message": "(#3) Application does not have the capability to make this API call.",
"code": 3,
"fbtrace_id": "xxxxxx",
"type": "OAuthException"
}
}
Run Code Online (Sandbox Code Playgroud)
我的用户令牌权限有ads_management和ads_read,应用程序也有ads_reads和ads_management。
还有什么我想念的吗?
我正在尝试使用facebook-python-business-sdk和 python 3.7从 Facebook 的见解 API 获取基本广告级别数据。问题是我只能得到 25 个结果,即使帐户的活跃广告数量超过 25 个。
我在每个帐户上使用 get_insights 方法,传递 'level':'ad' 参数并在特定日期进行过滤。我还检查了我是否已达到 Facebook 的限制(使用此处提供的解释),但我什至没有接近限制。get_insights 方法没有“限制”参数,无论哪种方式,我都不想限制它,因为某些帐户可能有数百甚至数千个广告。
这是我正在使用的代码
from facebook_business.api import FacebookAdsApi
from facebook_business.adobjects.adaccount import AdAccount
from facebook_business.adobjects.adaccountuser import AdAccountUser
from facebook_business.adobjects.campaign import Campaign as AdCampaign
from facebook_business.adobjects.adsinsights import AdsInsights
access_token = '******'
app_secret = '******'
app_id = '******'
FacebookAdsApi.init(app_id, app_secret, access_token)
me = AdAccountUser(fbid='me')
my_accounts = list(me.get_ad_accounts())
params={'time_range': {'since': '2019-06-29', 'until': '2019-06-29'},'level': 'ad'}
fields = [AdsInsights.Field.account_id,
AdsInsights.Field.account_name,
AdsInsights.Field.ad_id,
AdsInsights.Field.ad_name,
AdsInsights.Field.adset_id,
AdsInsights.Field.adset_name,
AdsInsights.Field.campaign_id,
AdsInsights.Field.campaign_name,
AdsInsights.Field.spend, …Run Code Online (Sandbox Code Playgroud) facebook-insights facebook-marketing-api facebook-python-business-sdk
我尝试使用 Python Business SDK 通过 Facebook 的营销 API 获取营销活动洞察,但收到 FacebookRequestError:
Message: Call was not successful
Method: GET
Path: https://graph.facebook.com/v3.1/2603111949730990/insights
Params: {}
Status: 400
Response:
{
"error": {
"message": "Error accessing adreport job.",
"type": "OAuthException",
"code": 2601,
"error_subcode": 1815107,
"is_transient": true,
"error_user_title": "Loading Async Ads Report Failed",
"error_user_msg": "Sorry, the report cannot be loaded successfully. Please check if your job status is completed instead of failed or running before fetching the data.",
"fbtrace_id": "BQJsdi3g5tX"
}
}
Run Code Online (Sandbox Code Playgroud)
我已经尝试通过检查作业状态是否不是“作业已完成”以及作业完成的百分比是否小于 100 来修改 wait_for_async_job() 函数的代码,但问题仍然存在。 …
python django facebook-marketing-api facebook-python-business-sdk