本文整理汇总了Python中facebookads.objects.AdAccount.remote_read方法的典型用法代码示例。如果您正苦于以下问题:Python AdAccount.remote_read方法的具体用法?Python AdAccount.remote_read怎么用?Python AdAccount.remote_read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类facebookads.objects.AdAccount
的用法示例。
在下文中一共展示了AdAccount.remote_read方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: AdAccount
# 需要导入模块: from facebookads.objects import AdAccount [as 别名]
# 或者: from facebookads.objects.AdAccount import remote_read [as 别名]
account_id = config['account_id']
access_token = config['access_token']
app_id = config['app_id']
app_secret = config['app_secret']
FacebookAdsApi.init(app_id, app_secret, access_token)
# _DOC open [ADACCOUNT_READ]
# _DOC vars [account_id:s]
from facebookads.objects import AdAccount
account = AdAccount(account_id)
account.remote_read(fields=[
AdAccount.Field.name,
AdAccount.Field.balance
])
print(account[AdAccount.Field.name])
print(account[AdAccount.Field.balance])
# _DOC close [ADACCOUNT_READ]
# _DOC vars [account_id:s]
from facebookads.objects import AdAccount
account = AdAccount(account_id)
account.remote_read(fields=[AdAccount.Field.name])
old_name = account[AdAccount.Field.name]
# _DOC open [ADACCOUNT_UPDATE]
# _DOC vars [account_id:s]
from facebookads.objects import AdAccount
示例2: AdAccount
# 需要导入模块: from facebookads.objects import AdAccount [as 别名]
# 或者: from facebookads.objects.AdAccount import remote_read [as 别名]
# DEALINGS IN THE SOFTWARE.
from facebookads import test_config
from facebookads.objects import AdLabel
from examples.docs import fixtures
ad_account_id = test_config.account_id
# _DOC open [ADACCOUNT_READ]
# _DOC vars [ad_account_id:s]
from facebookads.objects import AdAccount
account = AdAccount(ad_account_id)
account.remote_read(fields=[
AdAccount.Field.name,
AdAccount.Field.balance
])
print(account[AdAccount.Field.name])
print(account[AdAccount.Field.balance])
# _DOC close [ADACCOUNT_READ]
# _DOC open [ADACCOUNT_READ_TOS_ACCEPTED]
# _DOC vars [ad_account_id:s]
from facebookads.objects import AdAccount
account = AdAccount(ad_account_id)
account.remote_read(fields=[AdAccount.Field.tos_accepted])
for tos in account[AdAccount.Field.tos_accepted]:
print(tos)
示例3: print
# 需要导入模块: from facebookads.objects import AdAccount [as 别名]
# 或者: from facebookads.objects.AdAccount import remote_read [as 别名]
from __future__ import unicode_literals
'''
This is a template for DocSmith samples in Python. This file will throw an
exception. This is used to test facebookads/docs_runner/doc_runner.py
when something breaks
'''
import sys
import os
this_dir = os.path.dirname(__file__)
repo_dir = os.path.join(this_dir, os.pardir, os.pardir)
sys.path.insert(1, repo_dir)
from facebookads import bootstrap
bootstrap.auth()
'''
Example tha intentionally throws an exception to be used as a test for
DocExampleTest
'''
from facebookads.objects import AdAccount
if __name__ == '__main__':
ad_account_id = 'invalid_id_1111'
print('**** READ AD ACCOUNT ****')
ad_account = AdAccount(fbid=ad_account_id)
ad_account.remote_read()
print(ad_account.remote_read())
示例4: AdAccount
# 需要导入模块: from facebookads.objects import AdAccount [as 别名]
# 或者: from facebookads.objects.AdAccount import remote_read [as 别名]
# form for use in connection with the web services and APIs provided by
# Facebook.
# As with any software that integrates with the Facebook platform, your use
# of this software is subject to the Facebook Developer Principles and
# Policies [http://developers.facebook.com/policy/]. This copyright notice
# shall be included in all copies or substantial portions of the software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
from facebookads import test_config
ad_account_id = test_config.account_id
# _DOC open [ADACCOUNT_READ_TOS_ACCEPTED]
# _DOC vars [ad_account_id:s]
from facebookads.objects import AdAccount
account = AdAccount(ad_account_id)
account.remote_read(fields=[AdAccount.Field.tos_accepted])
for tos in account[AdAccount.Field.tos_accepted]:
print(tos)
# _DOC close [ADACCOUNT_READ_TOS_ACCEPTED]
示例5: AdAccount
# 需要导入模块: from facebookads.objects import AdAccount [as 别名]
# 或者: from facebookads.objects.AdAccount import remote_read [as 别名]
# shall be included in all copies or substantial portions of the software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
from facebookads import test_config
from facebookads.objects import AdAccount
ad_account_id = test_config.account_id
account = AdAccount(ad_account_id)
account.remote_read(fields=[AdAccount.Field.name])
old_name = account[AdAccount.Field.name]
# _DOC open [ADACCOUNT_UPDATE]
# _DOC vars [ad_account_id:s]
from facebookads.objects import AdAccount
account = AdAccount(ad_account_id)
account[AdAccount.Field.name] = 'New Name'
account.remote_update()
# _DOC close [ADACCOUNT_UPDATE]
account[AdAccount.Field.name] = old_name
account.remote_update()
示例6: AdAccount
# 需要导入模块: from facebookads.objects import AdAccount [as 别名]
# 或者: from facebookads.objects.AdAccount import remote_read [as 别名]
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
'''
This is a template for DocSmith samples in Python. Copy it and create yours
Code should follow guidelines at
https://our.intern.facebook.com/intern/wiki/Solutions_Engineering/DocSmith
facebookads repo folder must be added to PYTHONPATH in order to run
Comments on style:
- IDs should be defined outside of _DOC blocks so they don't appear into the
docs
'''
from facebookads import test_config as config
ad_account_id = config.account_id
#! _DOC open [READ_ADACCOUNT]
# _DOC vars [ad_account_id]
from facebookads.objects import AdAccount
ad_account = AdAccount(fbid=ad_account_id)
ad_account.remote_read()
print(ad_account)
#! _DOC close [READ_ADACCOUNT]