@juanshishido: We are pulling data first at account level and then campaign level. So one parent account has access to multiple Twitter Ad accounts.
Request at account level:
resource = ‘/0/accounts/’.format(account_id=account.id)
response = Request(client, ‘get’, resource, params=params).perform()
params is empty till this level.
We then iterate through the accounts extracted and extract data from all campaigns inside each acccount.
Request at Campaign Level:
resource = ‘/0/stats/accounts/{accid}/campaigns/{campid}’.format(accid=row[‘account_id’] ,campid=row[‘campaign_id’])
params = {‘start_time’:row[‘startdt’],‘end_time’:row[‘enddt’],‘granularity’:‘DAY’,‘metrics’:‘promoted_video_total_views,promoted_tweet_profile_impressions,promoted_tweet_search_impressions,promoted_tweet_timeline_impressions,promoted_tweet_search_engagements,promoted_tweet_profile_engagements,promoted_tweet_timeline_engagements,promoted_account_follows,billed_charge_local_micro,billed_engagements,billed_follows,promoted_tweet_search_url_clicks,promoted_tweet_timeline_url_clicks,promoted_tweet_profile_url_clicks,promoted_tweet_search_clicks,promoted_tweet_timeline_clicks,promoted_tweet_profile_clicks’}
response = Request(client, ‘get’, resource, params=params).perform()
Thanks