Display existing CRM based user list

83 views
Skip to first unread message

Fernando Finelli

unread,
Apr 24, 2018, 5:49:41 PM4/24/18
to AdWords API and Google Ads API Forum
Hello,

I not found some example to display the existing CRM based user list.

How can I do that?

Peter Oliquino (AdWords API Team)

unread,
Apr 24, 2018, 11:15:24 PM4/24/18
to adwor...@googlegroups.com
Hi Fernando,

Could you confirm if what you wish is to retrieve your CrmBasedUserList information? If yes, my apologies as we do not have a direct example for this. You can, however, use the AdwordsUserListService.get() to achieve this. You may refer to my sample SOAP request and response below :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
        <ns1:RequestHeader xmlns:ns1="https://adwords.google.com/api/adwords/rm/v201802" soapenv:mustUnderstand="0">
            <ns2:clientCustomerId xmlns:ns2="https://adwords.google.com/api/adwords/cm/v201802">YOUR_CUSTOMER_ID</ns2:clientCustomerId>
            <ns3:developerToken xmlns:ns3="https://adwords.google.com/api/adwords/cm/v201802">REDACTED</ns3:developerToken>
            <ns4:userAgent xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201802">YOUR_USER_AGENT</ns4:userAgent>
            <ns5:validateOnly xmlns:ns5="https://adwords.google.com/api/adwords/cm/v201802">false</ns5:validateOnly>
            <ns6:partialFailure xmlns:ns6="https://adwords.google.com/api/adwords/cm/v201802">false</ns6:partialFailure>
        </ns1:RequestHeader>
    </soapenv:Header>
    <soapenv:Body>
        <get xmlns="https://adwords.google.com/api/adwords/rm/v201802">
            <serviceSelector>
                <ns7:fields xmlns:ns7="https://adwords.google.com/api/adwords/cm/v201802">Id</ns7:fields>
                <ns8:fields xmlns:ns8="https://adwords.google.com/api/adwords/cm/v201802">Name</ns8:fields>
                <ns9:fields xmlns:ns9="https://adwords.google.com/api/adwords/cm/v201802">MembershipLifeSpan</ns9:fields>
                <ns10:fields xmlns:ns10="https://adwords.google.com/api/adwords/cm/v201802">ListType</ns10:fields>
                <ns11:predicates xmlns:ns11="https://adwords.google.com/api/adwords/cm/v201802">
                    <ns11:field>ListType</ns11:field>
                    <ns11:operator>EQUALS</ns11:operator>
                    <ns11:values>CRM_BASED</ns11:values>
                </ns11:predicates>
                <ns12:ordering xmlns:ns12="https://adwords.google.com/api/adwords/cm/v201802">
                    <ns12:field>Name</ns12:field>
                    <ns12:sortOrder>ASCENDING</ns12:sortOrder>
                </ns12:ordering>
                <ns13:paging xmlns:ns13="https://adwords.google.com/api/adwords/cm/v201802">
                    <ns13:startIndex>0</ns13:startIndex>
                    <ns13:numberResults>100</ns13:numberResults>
                </ns13:paging>
            </serviceSelector>
        </get>
    </soapenv:Body>
</soapenv:Envelope>
[25 Apr 2018 10:42:57,394-soapXmlLogger:DEBUG:main] SOAP response:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <ns2:ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201802" xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201802">
            <requestId>YOUR_REQUEST_ID</requestId>
            <serviceName>AdwordsUserListService</serviceName>
            <methodName>get</methodName>
            <operations>1</operations>
            <responseTime>283</responseTime>
        </ns2:ResponseHeader>
    </soap:Header>
    <soap:Body>
        <ns2:getResponse xmlns="https://adwords.google.com/api/adwords/cm/v201802" xmlns:ns2="https://adwords.google.com/api/adwords/rm/v201802">
            <ns2:rval>
                <totalNumEntries>5</totalNumEntries>
                <Page.Type>UserListPage</Page.Type>
                <ns2:entries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:CrmBasedUserList">
                    <ns2:id>USERLISTID_1</ns2:id>
                    <ns2:isReadOnly>false</ns2:isReadOnly>
                    <ns2:name>Customer relationship management list #1466763899844</ns2:name>
                    <ns2:membershipLifeSpan>30</ns2:membershipLifeSpan>
                    <ns2:listType>CRM_BASED</ns2:listType>
                    <ns2:UserList.Type>CrmBasedUserList</ns2:UserList.Type>
                </ns2:entries>
                <ns2:entries xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:CrmBasedUserList">
                    <ns2:id>USERLISTID_2</ns2:id>
                    <ns2:isReadOnly>false</ns2:isReadOnly>
                    <ns2:name>Customer relationship management list #1469012136320</ns2:name>
                    <ns2:membershipLifeSpan>30</ns2:membershipLifeSpan>
                    <ns2:listType>CRM_BASED</ns2:listType>
                    <ns2:UserList.Type>CrmBasedUserList</ns2:UserList.Type>
                </ns2:entries>
            </ns2:rval>
        </ns2:getResponse>
    </soap:Body>
</soap:Envelope>

You may also note that retrieving the userlist members is currently not supported. Additionally, if what you wish is to retrieve their statistics, you may check out the Audience Performance Report, our reporting guide, and these sample codes (also available in other languages) for more information on how you can download the report. Let me know if this helps.

Best regards,
Peter
AdWords API Team
Reply all
Reply to author
Forward
0 new messages