本文整理汇总了Python中facebookads.objects.AdAccount.get_my_account方法的典型用法代码示例。如果您正苦于以下问题:Python AdAccount.get_my_account方法的具体用法?Python AdAccount.get_my_account怎么用?Python AdAccount.get_my_account使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类facebookads.objects.AdAccount
的用法示例。
在下文中一共展示了AdAccount.get_my_account方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: FacebookSession
# 需要导入模块: from facebookads.objects import AdAccount [as 别名]
# 或者: from facebookads.objects.AdAccount import get_my_account [as 别名]
config.readfp(config_file)
### Setup session and api objects
session = FacebookSession(
config.get('Authentication', 'app_id'),
config.get('Authentication', 'app_secret'),
config.get('Authentication', 'access_token'),
)
api = FacebookAdsApi(session)
if __name__ == '__main__':
FacebookAdsApi.set_default_api(api)
# Get my account (first account associated with the user associated with the
# session of the default api)
my_account = AdAccount.get_my_account()
print('**** Creating ad...')
# Create my ad
my_ad = ad_creation_utils.create_website_clicks_ad(
account=my_account,
name="Visit Seattle",
country='US',
title="Visit Seattle", # How it looks
body="Beautiful Puget Sound.",
url="http://www.seattle.gov/visiting/",
image_path=os.path.join(this_dir, 'test.png'),