Hi,

based on this example:
https://developers.google.com/adwords/api/docs/samples/python/advanced-operations#add-an-ad-group-level-bid-modifier
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
https://github.com/googleads/googleads-python-lib/issues/270
... 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

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/029e550a-e241-4e75-9f4b-7e60e5cf9d73%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
  • ... Matthias Baader
    • ... 'Milind Sankeshware (AdWords API Team)' via AdWords API and Google Ads API Forum
      • ... Matthias Baader

Reply via email to