Video campaigns are not retrieving through an API

19 views
Skip to first unread message

satish reddy

unread,
Nov 13, 2018, 7:09:53 PM11/13/18
to AdWords API and Google Ads API Forum
Hi Guys,

I tried below code to get all the campaigns ID's but its returning only "Display campaigns" not the "Video's campaigns" ID's.


 # Initialize appropriate service.
  campaign_service = client.GetService('CampaignService', version='v201806')

  # Construct selector and get all campaigns.
  offset = 0
  selector = {
      'fields': ['Id'],
      'paging': {
          'startIndex': str(offset),
          'numberResults': str(PAGE_SIZE)
      }
  }

  more_pages = True
  while more_pages:
    page = campaign_service.get(selector)

    # Display results.
    if 'entries' in page:
      for campaign in page['entries']:
        print ('Campaign with id "%s", name "%s", and status "%s" was '
               'found.' % (campaign['id'], campaign['name'],
                           campaign['status']))
    else:
      print 'No campaigns were found.'
    offset += PAGE_SIZE
    selector['paging']['startIndex'] = str(offset)
    more_pages = offset < int(page['totalNumEntries'])

Luis Xander Talag (AdWords API Team)

unread,
Nov 13, 2018, 9:19:24 PM11/13/18
to AdWords API and Google Ads API Forum
Hi Satish,

Video campaigns are currently only supported in reports in AdWords API based on this link. You may use Video Performance Report instead to retrieve their Campaign IDs.

Let me know if you have further clarifications. 

Thanks,
Luis
AdWords API Team

satish reddy

unread,
Nov 14, 2018, 7:17:30 AM11/14/18
to adwordsapiadvi...@google.com, adwor...@googlegroups.com
Thank you Juis, It worked.


--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api...@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/8bb5fdc0-1c83-4d60-90db-ac0aa93b2bac%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Regards,
Satish Kumar

Reply all
Reply to author
Forward
0 new messages