ManagedCustomerService Returns Empty Result

343 views
Skip to first unread message

Normunds Vilcins

unread,
Apr 4, 2018, 1:36:00 PM4/4/18
to AdWords API Forum
Hi!


We are fetching the list of managed customers like this:

    managed_customer_service = self._client.GetService('ManagedCustomerService', version='v201708')
    selector
= {
       
"fields": ['Name', 'CustomerId', 'CanManageClients'],
       
"paging": {
           
"startIndex": "0", "numberResults": "100",
       
}
   
}
    more_pages
= True
   
while more_pages:
        page
= managed_customer_service.get(selector)
       
# .. process page ..



This worked fine until recently. After looking into logs we saw this:

Response summary - {'requestId': 0005690...9b06, 'responseTime': 187, 'serviceName': CustomerService, 'methodName': getCustomers, 'operations': 0, 'isFault': True, 'faultMessage': "[RequestError.UNSUPPORTED_VERSION @ ; trigger:'You are accessing an AdWords API version v201708 that has been discontinued. Calls to this version may fail. Please visit the AdWords API blog for information on migration to the new AdWords API version.']"}


So we tried upgrading the version. Now, however, the call simply returns an empty result (no errors).

> print(page)
> {
>     'totalNumEntries': 0,
>     'Page.Type': 'ManagedCustomerPage',
>     'entries': [],
>     'links': []
> }

Tried with both "v201710" and "v201802".



logging.basicConfig(level=logging.INFO, format=googleads.util.LOGGER_FORMAT)
logging
.getLogger('suds.transport').setLevel(logging.DEBUG)

we only get this:

[2018-04-04 17:09:36,525 - googleads.soap - INFO] Request made: Service: "ManagedCustomerService" Method: "get" URL: "https://adwords.google.com/api/adwords/mcm/v201802/ManagedCustomerService"


Shouldn't be an authentication related problem because (a) we don't get any (including authentication related) errors, and (b) we get non-empty results from other endpoints (e.g., CustomerService).

Bharani Cherukuri (AdWords API Team)

unread,
Apr 4, 2018, 4:34:06 PM4/4/18
to AdWords API Forum
Hello, 

To get the client accounts under a manager account, you will need to make sure that the client customer Id in the request header is set to the manager account. If this does not fix your issue, could you please enable logging by setting the level as 'DEBUG' and share the SOAP logs including the header so that I can take a look? You could use reply privately to author while sharing the logs. You may refer to this guide on how the sample logs look like.

Regards,
Bharani, AdWords API Team

Normunds Vilcins

unread,
Apr 5, 2018, 5:44:07 AM4/5/18
to AdWords API Forum
(public answer with obfuscated sensitive information)

The account I am testing with has two managed accounts linked to it. It should (and has in the past) return both for the specified request. However, even if the second account has some problem, the original one is clearly a managed account, since I created it and am the only one who has access to it. Or am I misunderstanding something here?

Anyway, this is what I get with DEBUG level enabled for logging:

[2018-04-05 08:54:16,481 - googleads.soap - INFO] Request made: Service: "ManagedCustomerService" Method: "get" URL: "https://adwords.google.com/api/adwords/mcm/v201802/ManagedCustomerService"

[2018-04-05 08:54:16,481 - googleads.soap - DEBUG] 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/mcm/v201802">
     
<ns1:clientCustomerId xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201802">481XXX120</ns1:clientCustomerId>
      <ns2:developerToken xmlns:ns2="https:/
/adwords.google.com/api/adwords/cm/v201802">GPaXXXXXXXyw</ns2:developerToken>
      <ns3:userAgent xmlns:ns3="
https://adwords.google.com/api/adwords/cm/v201802">unknown (AwApi-Python, googleads/11.0.0, Python/3.6.0, zeep)</ns3:userAgent>
     
<ns4:validateOnly xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201802">false</ns4:validateOnly>
      <ns5:partialFailure xmlns:ns5="https:/
/adwords.google.com/api/adwords/cm/v201802">false</ns5:partialFailure>
    </ns0:RequestHeader>
  </soap-env:Header>
  <soap-env:Body>
    <ns0:get xmlns:ns0="
https://adwords.google.com/api/adwords/mcm/v201802">
     
<ns0:serviceSelector>
       
<ns1:fields xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201802">Name</ns1:fields>
        <ns2:fields xmlns:ns2="https:/
/adwords.google.com/api/adwords/cm/v201802">CustomerId</ns2:fields>
        <ns3:fields xmlns:ns3="
https://adwords.google.com/api/adwords/cm/v201802">CanManageClients</ns3:fields>
       
<ns4:paging xmlns:ns4="https://adwords.google.com/api/adwords/cm/v201802">
         
<ns4:startIndex>0</ns4:startIndex>
          <ns4:numberResults>100</
ns4:numberResults>
       
</ns4:paging>
      </
ns0:serviceSelector>
   
</ns0:get>
  </
soap-env:Body>
</soap-env:Envelope>

[2018-04-05 08:54:16,481 - zeep.transports - DEBUG] HTTP Post to https:/
/adwords.google.com/api/adwords/mcm/v201802/ManagedCustomerService:
<?xml version='1.0' encoding='utf-8'?>
<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/mcm/v201802">
           
<ns1:clientCustomerId
                xmlns
:ns1="https://adwords.google.com/api/adwords/cm/v201802">481XXX120
           
</ns1:clientCustomerId>
            <ns2:developerToken
                xmlns:ns2="https:/
/adwords.google.com/api/adwords/cm/v201802">GPaXXXXXXXyw
            </ns2:developerToken>
            <ns3:userAgent
                xmlns:ns3="
https://adwords.google.com/api/adwords/cm/v201802">unknown (AwApi-Python, googleads/11.0.0, Python/3.6.0, zeep)
           
</ns3:userAgent>
            <ns4:validateOnly
                xmlns:ns4="https:/
/adwords.google.com/api/adwords/cm/v201802">false
            </ns4:validateOnly>
            <ns5:partialFailure
                xmlns:ns5="
https://adwords.google.com/api/adwords/cm/v201802">false
           
</ns5:partialFailure>
        </
ns0:RequestHeader>
   
</soap-env:Header>
    <soap-env:Body>
        <ns0:get
            xmlns:ns0="https:/
/adwords.google.com/api/adwords/mcm/v201802">
            <ns0:serviceSelector>
                <ns1:fields
                    xmlns:ns1="
https://adwords.google.com/api/adwords/cm/v201802">Name
               
</ns1:fields>
                <ns2:fields
                    xmlns:ns2="https:/
/adwords.google.com/api/adwords/cm/v201802">CustomerId
                </ns2:fields>
                <ns3:fields
                    xmlns:ns3="
https://adwords.google.com/api/adwords/cm/v201802">CanManageClients
               
</ns3:fields>
                <ns4:paging
                    xmlns:ns4="https:/
/adwords.google.com/api/adwords/cm/v201802">
                    <ns4:startIndex>0</ns4:startIndex>
                    <ns4:numberResults>100</ns4:numberResults>
                </ns4:paging>
            </ns0:serviceSelector>
        </ns0:get>
    </soap-env:Body>
</soap-env:Envelope>

[2018-04-05 08:54:17,222 - zeep.transports - DEBUG] HTTP Response from https://adwords.google.com/api/adwords/mcm/v201802/ManagedCustomerService (status: 200):
<soap:Envelope
    xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
   
<soap:Header>
       
<ns2:ResponseHeader
            xmlns
:ns2="https://adwords.google.com/api/adwords/mcm/v201802"
            xmlns
="https://adwords.google.com/api/adwords/cm/v201802">
           
<requestId>00056916XXX01d944</requestId>
            <serviceName>ManagedCustomerService</
serviceName>
           
<methodName>get</methodName>
            <operations>1</
operations>
           
<responseTime>181</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/mcm/v201802">
           
<ns2:rval>
               
<totalNumEntries>0</totalNumEntries>
                <Page.Type>ManagedCustomerPage</
Page.Type>
           
</ns2:rval>
        </
ns2:getResponse>
   
</soap:Body>
</
soap:Envelope>

[2018-04-05 08:54:17,223 - googleads.soap - DEBUG] Incoming response:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 
<soap:Header>
   
<ns2:ResponseHeader xmlns:ns2="https://adwords.google.com/api/adwords/mcm/v201802" xmlns="https://adwords.google.com/api/adwords/cm/v201802">
     
<requestId>00056916XXX01d944</requestId>
      <serviceName>ManagedCustomerService</
serviceName>
     
<methodName>get</methodName>
      <operations>1</
operations>
     
<responseTime>181</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/mcm/v201802">
     
<ns2:rval>
       
<totalNumEntries>0</totalNumEntries>
        <Page.Type>ManagedCustomerPage</
Page.Type>
     
</ns2:rval>
    </
ns2:getResponse>
 
</soap:Body>
</
soap:Envelope>

Bharani Cherukuri (AdWords API Team)

unread,
Apr 5, 2018, 2:40:37 PM4/5/18
to AdWords API Forum
Hello, 

Thank you for sharing the SOAP logs. It looks like if the client account is specified in the request header, it is not returning any results. I was able to replicate the issue with the latest version of the AdWords API while using the Python client library. I have shared this information with the team. I will keep you posted if I have any new information.

Regards,
Bharani, AdWords API Team

On Wednesday, April 4, 2018 at 1:36:00 PM UTC-4, Normunds Vilcins wrote:

loreda...@cognetik.com

unread,
May 18, 2018, 11:47:14 AM5/18/18
to AdWords API and Google Ads API Forum
Hello,

Ww are facing the same issue.  
We fetch the accounts using this function:

       managed_customer_service = self.client.GetService(
            'ManagedCustomerService', version=self.ADWORDS_VERSION)

        # Construct selector to get all accounts.
        offset = 0
        selector = {
            'fields': ['CustomerId', 'Name', 'CanManageClients'],
            'paging': {
                'startIndex': str(offset),
                'numberResults': str(500)
            }
        }
more_pages = True  
while more_pages:
         page = managed_customer_service.get(selector)

 This call returns empty results. We've tried with both "v201710" and "v201802” versions.
 Do you have any update on this?  

Regards,
Loredana

Screen Shot 2018-05-18 at 2.36.32 PM.png

Bharani Cherukuri (AdWords API Team)

unread,
May 18, 2018, 4:04:01 PM5/18/18
to AdWords API and Google Ads API Forum
Hello Loredana, 

This is a known issue and our team is investigating this. I will update this thread if I have any new information to share. 

Thanks,
Bharani, AdWords API Team

On Wednesday, April 4, 2018 at 1:36:00 PM UTC-4, Normunds Vilcins wrote:

ra...@cognetik.com

unread,
Sep 20, 2018, 3:45:34 PM9/20/18
to AdWords API and Google Ads API Forum
Hi Bharani,

do you have any updates on this issue?

Thank you

Bharani Cherukuri (AdWords API Team)

unread,
Sep 20, 2018, 4:40:18 PM9/20/18
to AdWords API and Google Ads API Forum
Hello, 

Thank you for the follow-up. Currently we have no new updates from the team. I will update this thread as soon as I have any new information to share.

Sumeet Gadkari

unread,
May 30, 2019, 6:02:42 PM5/30/19
to AdWords API and Google Ads API Forum
Hi Bharani,

do you have any updates on this issue?

Thanks.

Google Ads API Forum Advisor Prod

unread,
May 31, 2019, 3:18:22 AM5/31/19
to adwor...@googlegroups.com
Hi Sumeet,

There is currently no updates from our team regarding the issue. We shall update this thread once we receive more information.

Thanks and regards,
Peter
Google Ads API Team

ref:_00D1U1174p._5001UBfoBX:ref

Google Ads API Forum Advisor Prod

unread,
May 31, 2019, 3:45:53 AM5/31/19
to adwor...@googlegroups.com

Hi Sandeep,

As your concern appears to be related to a different topic, I would recommend that you create a new thread and we can continue our discussion from there instead.

Best regards,


Peter
Google Ads API Team



ref:_00D1U1174p._5001UBfoBX:ref

Sandeep Yadav

unread,
Jun 3, 2019, 2:26:53 AM6/3/19
to adsapifor...@gmail.com, adwor...@googlegroups.com
Hi Everyone,

I am using google adwords api to get campaigns reports. While i am accessing the reports response getAsString() then i can see the report is being string format.

I don't want an report to be String. I want the result in an array format

Can you please help me to fix this issues.

Thank  You

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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...@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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/JWnXL000000000000000000000000000000000000000000000PSCXM700-jApODeKScaID-CfvYXoCg%40sfdc.net.
Reply all
Reply to author
Forward
0 new messages