Unexpected internal API error for AdGroupService

20 views
Skip to first unread message

Liron Shapira

unread,
Oct 23, 2017, 1:51:00 AM10/23/17
to AdWords API Forum
Here's the code:

    campaign_ids = params.get('campaignIds')
    ad_group_service
= adwords_client.GetService('AdGroupService', version='v201708')
    selector
= {
       
'predicates': [
           
{
               
'field': 'CampaignId',
               
'operator': 'EQUALS',
               
'values': campaign_ids
           
}
       
],
       
'fields': ['Id', 'Name', 'Status', 'CpcBid']
   
}
    response
= ad_group_service.get(selector)


When campaign_ids is an array with a single campaign ID, this works fine to fetch some ad groups. When I try two campaign IDs, I get InternalApiError.UNEXPECTED_INTERNAL_API_ERROR.

Peter Oliquino

unread,
Oct 23, 2017, 4:11:07 AM10/23/17
to AdWords API Forum
Hi Liron,

I would recommend that you use the IN operator instead of EQUALS if you wish to pass a list of campaign IDs in your AdGroupService.get() call. Let me know if this helps.

Thanks and regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages