CampaignSharedSetService getting InternalApiError.UNEXPECTED_INTERNAL_API_ERROR

57 views
Skip to first unread message

Daphna Wegner

unread,
Nov 18, 2016, 3:33:22 PM11/18/16
to AdWords API Forum
Hi I am getting this error while doing a simple call to get the shared sets for certain campaigns:

shared_criterion_service = client.GetService('SharedCriterionService',
                                                   version='v201607')
      campaign_shared_set_service = client.GetService('CampaignSharedSetService',
                                                      version='v201607')

      shared_set_ids = []
      criterion_ids = []

      # First, retrieve all shared sets associated with the campaign.

      # Create selector for shared sets to:
      # - filter by campaign ID,
      # - filter by shared set type.
      selector = {
          'fields': ['SharedSetId', 'CampaignId', 'SharedSetName', 'SharedSetType',
                     'Status'],
          'predicates': [
              {
                  'field': 'CampaignId',
                  'operator': 'EQUALS',
                  'values': [campaigns]
              },
              {
                  'field': 'SharedSetType',
                  'operator': 'IN',
                  'values': ['NEGATIVE_KEYWORDS']
              }
          ],
          'paging': {
              'startIndex': 0,
              'numberResults': PAGE_SIZE
          }
      }

      # Set initial values:
      offset = 0
      page = {'totalNumEntries': 1}

      while page['totalNumEntries'] > offset:
        page = campaign_shared_set_service.get(selector)  ====> error is raised after calling this line

**This is taken from the example in the googleads github python library

Error:

Server raised fault: '[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.<init>(InternalApiErro]'

   

Shwetha Vastrad (AdWords API Team)

unread,
Nov 18, 2016, 4:29:17 PM11/18/16
to AdWords API Forum
Hi Daphna,

UNEXPECTED_INTERNAL_API_ERROR is usually transient mostly due to a temporary resource related issues in the AdWords API server. You need to retry the request after waiting for about 30 seconds. If this error occurs frequently, please provide the SOAP XML request and response logs so I can further investigate. Please use Reply privately to author when responding. 

Regards,
Shwetha, AdWords API Team.

Shwetha Vastrad (AdWords API Team)

unread,
Nov 21, 2016, 10:40:07 AM11/21/16
to AdWords API Forum
Hi Daphna,

The EQUALS operand in the predicate accepts a single value. This is the reason you encountered InternalApiError.UNEXPECTED_INTERNAL_API_ERROR when using multiple CampaignIds in the predicate. You need to use the IN operator which accepts multiple operands and can be used with integers, booleans, strings and enums. 

Daphna Wegner

unread,
Nov 21, 2016, 1:33:55 PM11/21/16
to AdWords API Forum

Thanks Shwetha that fixed the problem!
Reply all
Reply to author
Forward
Message has been deleted
0 new messages