Error [RequiredError.REQUIRED @ operations[0].operand.rules[0].ruleOperands[0].rule, RequiredError.REQUIRED @ operations[0].operand.rules[0].ruleOperands[1].rule] while creating logical user list using python adwords api

73 views
Skip to first unread message

The DiMaAg

unread,
Jan 22, 2019, 3:12:42 PM1/22/19
to AdWords API and Google Ads API Forum
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?
add_user_list_test.py

googleadsapi...@google.com

unread,
Jan 23, 2019, 2:51:45 AM1/23/19
to adwor...@googlegroups.com, AdWords API and Google Ads API Forum
Hi,

Thank you for the details you've provided. Based on your code, it appears that you are not setting up the rule properly. Kindly refer to the Python sample code as a reference.

Let me know if you have further clarifications.

Thanks,
Kevin
AdWords API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 adwords-api+unsubscribe@googlegroups.com.
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.

The DiMaAg

unread,
Feb 25, 2019, 8:37:00 AM2/25/19
to AdWords API and Google Ads API Forum
Hi Kevin,

Apologies for the delay in responding. I was away for work for a significant amount of time and this got skipped.

I checked the example given by you. But it doesn't have a method to create the LogicalUserList which I am trying to create.

Can you please be more specific what I am missing here?

Many Thanks in advance,

googleadsapi...@google.com

unread,
Feb 25, 2019, 3:47:29 PM2/25/19
to AdWords API and Google Ads API Forum
Hello, 

I'm Kevin's colleague addressing your concern as he is out of office. I understand you're looking to create an ExpressionRuleUserList. The error you're receiving indicates that you're missing to define some required entities in your request. In this case, the missed field is Rule. Please check this guide on how to create Rule-based user lists. You may refer to the code sample in the shared link as a reference. You will need to create a Rule with rule item groups to AND their rules together. Could you please refer to the shared code samples and let me know if you have any other questions?

Regards,
Bharani, AdWords API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

The DiMaAg

unread,
Feb 26, 2019, 5:04:32 PM2/26/19
to AdWords API and Google Ads API Forum
Dear Bharani,

The given guide has only code in java while I was typically looking for an implementation guidance for python. If you look at the start of the thread the attachment has the code in python that I am using for the same. Secondly, I am creating a LogicalUserList and
not ExpressionRuleUserList. Can I please expect due diligence from the Adwords API Team while answering a question?  

Please allow me to thank you whole-heartedly in anticipation for providing the right guidance,

googleadsapi...@google.com

unread,
Feb 27, 2019, 1:31:47 PM2/27/19
to AdWords API and Google Ads API Forum
Hello, 

We understand that you're creating a LogicalUserList with a combination of ExpressionUserLists which are combined with UserListLogicalRule fields. The rules in the LogicalUserList are ANDed so a user must match every rule to be considered in the list. When you're adding an ExpressionUserList as a RuleOperand, you will need to add all the required entities. In this case, the missed field is Rule as it is one of the required field. Please find the attached sample SOAP logs as a reference. Let me know if you have any other questions. 

Thanks,
Bharani, AdWords API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Sample_Logs.rtf
Reply all
Reply to author
Forward
0 new messages