retrieving negative keywords from shared sets

37 views
Skip to first unread message

Daphna Wegner

unread,
Dec 1, 2016, 6:55:16 PM12/1/16
to AdWords API Forum
When trying to retrieve all negative keywords from shared sets I have a predicate for campaign ID's (I want to get the shared sets that belong only to these campaigns)

I have noticed that if there are no shared sets for the campaigns in the list it returns an error instead of returning an empty result. How can this be run on accounts where I do not know in advance if there are shared sets for specific campaigns?

this is the error:

WebFault: Server raised fault: '[SelectorError.MISSING_PREDICATE_VALUES @ selector]'

when running:

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

      shared_set_ids = []
      criterion_ids = []


      selector = {
          'fields': ['SharedSetId', 'CampaignId', 'SharedSetName', 'SharedSetType',
                     'Status'],
          'predicates': [
              {
                  'field': 'CampaignId',
                  'operator': 'IN',
                  'values': [campaigns]
              },
              {
                  'field': 'SharedSetType',
                  'operator': 'IN',
                  'values': ['NEGATIVE_KEYWORDS']
              }
          ],
          'paging': {
              'startIndex': 0,
              'numberResults': PAGE_SIZE
          }
      }

Joyce Lava

unread,
Dec 1, 2016, 10:12:10 PM12/1/16
to AdWords API Forum
Hello Daphna,

Could you please send me (reply privately to author) the complete SOAP request and response to better check the service you're calling? Based on the code snippet above, there are 2 services you are calling, first is the SharedCriterionService in which the selectable fields can be found here. That said, it seems what you are selecting is the CampaignSharedSet, not SharedCriterionService.

I would need to check the complete SOAP request and response to further investigate if there are values being passed in the variable "campaigns".

Thanks,
Joyce, AdWords API Team
Reply all
Reply to author
Forward
0 new messages