如何让 Facebook 的 python 业务 SDK 使用最新的 Ads API 版本 (v13.0)?
How can I get Facebook's python business SDK to use the latest Ads API version (v13.0)?
当我调用 Ads API 时,我收到以下错误消息,告诉我正在调用已弃用的 Ads API:
"message": "(#2635) You are calling a deprecated version of the Ads
API. Please update to the latest version: v13.0."
这是 returns 错误的代码:
from facebook_business.adobjects.adaccount import AdAccount
from facebook_business.adobjects.customaudience import CustomAudience
from facebook_business.api import FacebookAdsApi
access_token = '123456678910'
id = 'act_12345678910'
FacebookAdsApi.init(access_token=access_token)
fields = [
]
params = {
'name': 'My new Custom Audience',
'subtype': 'CUSTOM',
'description': 'People who purchased on my website',
'customer_file_source': 'USER_PROVIDED_ONLY',
}
AdAccount(id).create_custom_audience(
fields=fields,
params=params,
)
有没有办法配置 SDK 以使用最新版本的广告 API?
有一个 API 配置文件,您可以在以下位置更新它:
/facebook_business/apiconfig.py
其中包含:
ads_api_config = {
'API_VERSION': 'v12.0',
'SDK_VERSION': 'v12.0.1',
'STRICT_MODE': False
}
您可以将 api_version='v13.0' 作为参数传递给 FacebookAdsApi.init(access_token=access_token).
例如 - FacebookAdsApi.init(access_token=access_token, api_version='v13.0')
当我调用 Ads API 时,我收到以下错误消息,告诉我正在调用已弃用的 Ads API:
"message": "(#2635) You are calling a deprecated version of the Ads API. Please update to the latest version: v13.0."
这是 returns 错误的代码:
from facebook_business.adobjects.adaccount import AdAccount
from facebook_business.adobjects.customaudience import CustomAudience
from facebook_business.api import FacebookAdsApi
access_token = '123456678910'
id = 'act_12345678910'
FacebookAdsApi.init(access_token=access_token)
fields = [
]
params = {
'name': 'My new Custom Audience',
'subtype': 'CUSTOM',
'description': 'People who purchased on my website',
'customer_file_source': 'USER_PROVIDED_ONLY',
}
AdAccount(id).create_custom_audience(
fields=fields,
params=params,
)
有没有办法配置 SDK 以使用最新版本的广告 API?
有一个 API 配置文件,您可以在以下位置更新它:
其中包含:
ads_api_config = {
'API_VERSION': 'v12.0',
'SDK_VERSION': 'v12.0.1',
'STRICT_MODE': False
}
您可以将 api_version='v13.0' 作为参数传递给 FacebookAdsApi.init(access_token=access_token).
例如 - FacebookAdsApi.init(access_token=access_token, api_version='v13.0')