Reputation: 1
I literally copied this code from Facebook's documentation.
But I get this error:
TypeError: get() got an unexpected keyword argument 'fields
the code I copied:
facebook_business.adobjects.adcreative import AdCreative
from facebook_business.api import FacebookAdsApi
access_token = '<ACCESS_TOKEN>'
app_secret = '<APP_SECRET>'
app_id = '<APP_ID>'
id = '<AD_CREATIVE_ID>'
FacebookAdsApi.init(access_token=access_token)
fields = [
'name',
'object_story_id',
]
params = {
}
print AdCreative(id).get(
fields=fields,
params=params,
)
Upvotes: 0
Views: 921
Reputation: 31
There's a mistake in Facebook's documentation. .get() does not exist. Use api_get() instead.
Upvotes: 3