skip to Main Content

When I call the Ads API I get the following error message telling me that I’m calling a deprecated version of the Ads API:

"message": "(#2635) You are calling a deprecated version of the Ads
API. Please update to the latest version: v13.0."

Here’s the code that returns the error:

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,
)

Is there a way to configure the SDK to use the latest version of the Ads API?

2

Answers


  1. Chosen as BEST ANSWER

    There is an API config file which you can update found in:

    <VIRTUAL_ENV>/facebook_business/apiconfig.py

    which contains:

    ads_api_config = {
      'API_VERSION': 'v12.0',
      'SDK_VERSION': 'v12.0.1',
      'STRICT_MODE': False
    }
    

  2. You can pass api_version=’v13.0′ as an argument in FacebookAdsApi.init(access_token=access_token).

    Eg – FacebookAdsApi.init(access_token=access_token, api_version=’v13.0′)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search