Select all adGroup, keywords, ads (Enabled, removed, paused)

144 views
Skip to first unread message

Yali Wang

unread,
Dec 14, 2016, 7:13:39 PM12/14/16
to AdWords API Forum
Hi Api team,

Recently I meet an issue with selection, I need to do some update on our paused or removed adgroups or other objects. I am having some issue with selecting these object for further operations. I basically follow the code example here, but seems like I cannot select paused adGroup, 

// Get the AdGroupService.
AdGroupServiceInterface adGroupService =
adWordsServices.get(session, AdGroupServiceInterface.class);

int offset = 0;
boolean morePages = true;

// Create selector.
SelectorBuilder builder = new SelectorBuilder();
Selector selector = builder
.fields(AdGroupField.Id, AdGroupField.Name)
.orderAscBy(AdGroupField.Name)
.offset(offset)
.limit(PAGE_SIZE)
.equals(AdGroupField.CampaignId, campaignId.toString())
.in(AdGroupField.Status, "ENABLED", "PAUSED")
.build();

Always return null, I think this might happen if I want to select other objects. 

Do you have any idea how to work around this  ?

Best regards
Yali

Anthony Madrigal

unread,
Dec 14, 2016, 7:53:25 PM12/14/16
to AdWords API Forum
Hi Yali,

The code snippet you have should select enabled and paused ad groups in the campaign with the Id you provided. Could you please reply privately to author your SOAP request and response, so I can see why it is returning null?

Thanks,
Anthony
AdWords API Team

Yali Wang

unread,
Dec 15, 2016, 1:21:51 PM12/15/16
to AdWords API Forum
Thanks Anthony and API team, we figured it out.

Thanet Knack Praneenararat (AdWords API Team)

unread,
Dec 15, 2016, 5:47:38 PM12/15/16
to AdWords API Forum
Hello Yali,

I'm glad that you can figure it out. :-)
Feel free to reach out to us next time.

Best,
Thanet, AdWords API Team
Reply all
Reply to author
Forward
0 new messages