本文整理匯總了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'),