Marketing API Version

Campaign

Fields

account_id, adlabels, buying_type, configured_status, effective_status, id, is_completed, name, objective, promoted_object, spend_cap, start_time, stop_time, updated_time

Campaign.get_ad_sets (fields, params)

Returns iterator over AdSet's associated with this campaign.

Name Type Description Required

fields

array

A list of fields to read.

No

params

map

A mapping of request parameters where a key is the parameter name and its value is a string or an object which can be JSON-encoded.

No

Sample Code

campaign = Campaign('6040236437840')
adsets = campaign.get_ad_sets(fields=[
    AdSet.Field.name,
    AdSet.Field.id,
    AdSet.Field.daily_budget,
])
print adsets[0]

Campaign.get_ads (fields, params)

Returns iterator over Ad's associated with this campaign.

Name Type Description Required

fields

array

A list of fields to read.

No

params

map

A mapping of request parameters where a key is the parameter name and its value is a string or an object which can be JSON-encoded.

No

Sample Code

campaign = Campaign('6040236437840')
ads = campaign.get_ads(fields=[
    Ad.Field.name,
    Ad.Field.configured_status,
    Ad.Field.creative,
])
print ads