Hi Team,

I am trying to add a logical user list in one of my client account.

I use the attached python script for the same.

I get the following SOAP request generated at run-time:

INFO:googleads.soap:Request made: Service: "AdwordsUserListService" Method: 
"mutate" URL: 
"https://adwords.google.com/api/adwords/rm/v201809/AdwordsUserListService";
DEBUG:googleads.soap:Outgoing request: {'SOAPAction': '""', 'Content-Type': 
'text/xml; charset=utf-8', 'authorization': 'REDACTED'}
<soap-env:Envelope 
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/";>
  <soap-env:Header>
    <ns0:RequestHeader 
xmlns:ns0="https://adwords.google.com/api/adwords/rm/v201809";>
      <ns1:clientCustomerId 
xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809";>1191454216</ns1:clientCustomerId>
      <ns2:developerToken 
xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201809";>xxxxxxxxxxxxxxxxxxxx</ns2:developerToken>
      <ns3:userAgent 
xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201809";>unknown 
(AwApi-Python, googleads/14.1.0, Python/2.7.12, zeep)</ns3:userAgent>
      <ns4:validateOnly 
xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201809";>false</ns4:validateOnly>
      <ns5:partialFailure 
xmlns:ns5="https://adwords.google.com/api/adwords/cm/v201809";>false</ns5:partialFailure>
    </ns0:RequestHeader>
  </soap-env:Header>
  <soap-env:Body>
    <ns0:mutate 
xmlns:ns0="https://adwords.google.com/api/adwords/rm/v201809";>
      <ns0:operations>
        <ns1:operator 
xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201809";>ADD</ns1:operator>
        <ns0:operand xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:type="ns0:LogicalUserList">
          <ns0:name>userlist_logical_samir</ns0:name>
          <ns0:description>logical user list</ns0:description>
          <ns0:rules>
            <ns0:operator>ANY</ns0:operator>
            <ns0:ruleOperands>
              <ns0:UserList xsi:type="ns0:ExpressionRuleUserList">
                <ns0:id>753510197</ns0:id>
              </ns0:UserList>
            </ns0:ruleOperands>
            <ns0:ruleOperands>
              <ns0:UserList xsi:type="ns0:ExpressionRuleUserList">
                <ns0:id>753510200</ns0:id>
              </ns0:UserList>
            </ns0:ruleOperands>
          </ns0:rules>
        </ns0:operand>
      </ns0:operations>
    </ns0:mutate>
  </soap-env:Body>
</soap-env:Envelope>

I get the following error upon processing the request:

[RequiredError.REQUIRED @ 
operations[0].operand.rules[0].ruleOperands[0].rule, RequiredError.REQUIRED 
@ operations[0].operand.rules[0].ruleOperands[1].rule]

Can you please help me understand the issue?

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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/1a3f9445-cfaa-4749-9957-efbf4410cea1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
import sys
import ast
import pandas as pd
import calendar
from datetime import date
from datetime import datetime
from datetime import timedelta
from googleads import adwords
import ast
import logging 

def main(client):
	logging.basicConfig(filename='example.log',level=logging.DEBUG)
	client_customer_account = sys.argv[1]
 	client.SetClientCustomerId(client_customer_account)
	# Initialize appropriate service.
 	adwords_user_list_service = client.GetService('AdwordsUserListService', version='v201809')
	logical_rule_k = {
		'operator': 'ANY',
		'ruleOperands': [
			{'UserList': {
				'xsi_type': 'ExpressionRuleUserList',
				'id': 753510197
				}	
			},
			{'UserList': {
				'xsi_type': 'ExpressionRuleUserList',
				'id': 753510200
				}
			}
		]	
	}
	operations = [
		{
			'operator': 'ADD',	
			'operand': {
				'xsi_type': 'LogicalUserList',
				'name': 'userlist_logical_samir',
				'description': 'logical user list',
				'rules': [logical_rule_k]
			}
		}  
	]
	# Submit the operations.
	user_lists = adwords_user_list_service.mutate(operations)

	# Display results.
	for user_list in user_lists['value']:
		print (('User list added with ID %d, name "%s", status "%s", list type'
		' "%s", accountUserListStatus "%s", description "%s".') %
		(user_list['id'], user_list['name'],
		user_list['status'], user_list['listType'],
		user_list['accountUserListStatus'], user_list['description']))

if __name__ == '__main__':
	# Initialize client object.
	adwords_client = adwords.AdWordsClient.LoadFromStorage()
	main(adwords_client)
  • Error [... The DiMaAg
    • RE... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
      • ... The DiMaAg
        • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum
          • ... The DiMaAg
            • ... googleadsapi-forumadvisor via AdWords API and Google Ads API Forum

Reply via email to