Campaign level ADD Platform bidModifier issue (Python)

107 views
Skip to first unread message

Matthias Baader

unread,
Aug 1, 2018, 12:00:55 PM8/1/18
to AdWords API and Google Ads API Forum
Hi,

based on this example:
I've tried to add/set platform bid modifiers on campaign level:

...
API_VERSION = "v201806"
campaign_bid_modifier_service = client.GetService('CampaignBidModifierService', 
                                                version=API_VERSION)
criterion_id = '30000'
bid_modifier = 1.6
operation = {
  'operator': 'ADD',
  'operand': {
      'campaignId': campaign_id,
      'criterion': {
          'xsi_type': 'Platform',
          'id': criterion_id
      },
      'bidModifier': bid_modifier
  }
}
response = campaign_bid_modifier_service.mutate([operation])
...

But unfortunately this results in a strange error message:

    response = campaign_bid_modifier_service.mutate([operation])
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1370, in MakeSoapRequest
    packed_args = self._PackArguments(method_name, args)
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1228, in _PackArguments
    for ((_, param), param_data) in izip(op_params, args)]
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1283, in _PackArgumentsHelper
    for item in data]
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1273, in _PackArgumentsHelper
    elem_type, type_override is not None, data_formatted, set_type_attrs)
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1340, in _CreateComplexTypeFromData
    for k, v in data if k != 'xsi_type'}
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1340, in <dictcomp>
    for k, v in data if k != 'xsi_type'}
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1273, in _PackArgumentsHelper
    elem_type, type_override is not None, data_formatted, set_type_attrs)
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1340, in _CreateComplexTypeFromData
    for k, v in data if k != 'xsi_type'}
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1340, in <dictcomp>
    for k, v in data if k != 'xsi_type'}
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1267, in _PackArgumentsHelper
    elem_type = self._DiscoverElementTypeFromLocalname(type_override)
  File "/home/skripte/.local/lib/python2.7/site-packages/googleads/common.py", line 1317, in _DiscoverElementTypeFromLocalname
    raise last_exception
zeep.exceptions.LookupError: No type 'Platform' in namespace http://www.w3.org/2001/XMLSchema. Available types are: {http://www.w3.org/2001/XMLSchema}int, {http://www.w3.org/2001/XMLSchema}unsignedShort, {http://www.w3.org/2001/XMLSchema}unsignedByte, {http://www.w3.org/2001/XMLSchema}NMTOKENS, {http://www.w3.org/2001/XMLSchema}nonNegativeInteger, {http://www.w3.org/2001/XMLSchema}negativeInteger, {http://www.w3.org/2001/XMLSchema}gMonth, {http://www.w3.org/2001/XMLSchema}normalizedString, {http://www.w3.org/2001/XMLSchema}ENTITIES, {http://www.w3.org/2001/XMLSchema}gYearMonth, {http://www.w3.org/2001/XMLSchema}nonPositiveInteger, {http://www.w3.org/2001/XMLSchema}token, {http://www.w3.org/2001/XMLSchema}anyType, {http://www.w3.org/2001/XMLSchema}IDREFS, {http://www.w3.org/2001/XMLSchema}time, {http://www.w3.org/2001/XMLSchema}QName, {http://www.w3.org/2001/XMLSchema}unsignedLong, {http://www.w3.org/2001/XMLSchema}NCName, {http://www.w3.org/2001/XMLSchema}date, {http://www.w3.org/2001/XMLSchema}string, {http://www.w3.org/2001/XMLSchema}ID, {http://www.w3.org/2001/XMLSchema}positiveInteger, {http://www.w3.org/2001/XMLSchema}ENTITY, {http://www.w3.org/2001/XMLSchema}byte, {http://www.w3.org/2001/XMLSchema}gDay, {http://www.w3.org/2001/XMLSchema}language, {http://www.w3.org/2001/XMLSchema}IDREF, {http://www.w3.org/2001/XMLSchema}anyURI, {http://www.w3.org/2001/XMLSchema}NOTATION, {http://www.w3.org/2001/XMLSchema}float, {http://www.w3.org/2001/XMLSchema}base64Binary, {http://www.w3.org/2001/XMLSchema}dateTime, {http://www.w3.org/2001/XMLSchema}hexBinary, {http://www.w3.org/2001/XMLSchema}Name, {http://www.w3.org/2001/XMLSchema}boolean, {http://www.w3.org/2001/XMLSchema}duration, {http://www.w3.org/2001/XMLSchema}gYear, {http://www.w3.org/2001/XMLSchema}unsignedInt, {http://www.w3.org/2001/XMLSchema}anySimpleType, {http://www.w3.org/2001/XMLSchema}integer, {http://www.w3.org/2001/XMLSchema}gMonthDay, {http://www.w3.org/2001/XMLSchema}decimal, {http://www.w3.org/2001/XMLSchema}double, {http://www.w3.org/2001/XMLSchema}long, {http://www.w3.org/2001/XMLSchema}short, {http://www.w3.org/2001/XMLSchema}NMTOKEN



When I googled this error message, I found this similar issue
... where zeep apparently was not looking in the right namespace.

So I wonder whether the problem is on my side or yours.
Could you please look into it?

Best regards
Matthias

Milind Sankeshware (AdWords API Team)

unread,
Aug 1, 2018, 6:01:04 PM8/1/18
to AdWords API and Google Ads API Forum
Hi Matthias,

Could you please post your concern in python client libraries issue tracker as the library owner is better equipped to address this issue?

Thanks,
Milind, AdWords API Team

Matthias Baader

unread,
Aug 1, 2018, 6:12:32 PM8/1/18
to AdWords API and Google Ads API Forum
Reply all
Reply to author
Forward
0 new messages