Hello AdWords folks,
Just as the topic says, I'm trying to migrate from v13/v201101 to v201109 and am curious about the suggested method for getting customerId in a non-mcc account. If I use the method suggested here
http://code.google.com/p/google-api-ads-python/source/browse/trunk/examples/adspygoogle/adwords/v201109/account_management/get_account_hierarchy.py I get a customerId of 0.
My only modification to the example was commenting out the print and adding a simpler one:
#print '%s%s%s, %s%s' % (prefix, account['login'], descriptive_name,
# account['customerId'], link_text)
print account
Here are my (sanitized) logs/output:
$ python get_account_hierarchy.py
[2012-01-17 14:16:21,506::DEBUG::AwApi-Python-15.1.4] StartTime: 2012-01-17 14:1
6:21
*** Outgoing HTTP headers **********************************************
POST /api/adwords/mcm/v201109/ServicedAccountService HTTP/1.0
Host:
adwords.google.comUser-agent:SOAPpy 0.12.0 (
pywebsvcs.sf.net),gzip
XML-parser: xml.etree.cElementTree v1.0.6
Content-type:text/xml; charset="UTF-8"
Content-length:694
Accept-Encoding:gzip
Content-Encoding:gzip
SOAPAction:"get"
************************************************************************
*** Outgoing SOAP ******************************************************
<?xml version='1.0' encoding='UTF-8'?>
<ns0:Envelope ns0:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/" xmln
s:ns0="
http://schemas.xmlsoap.org/soap/envelope/">
<ns0:Header>
<ns1:RequestHeader xmlns:ns1="
https://adwords.google.com/api/adwords/mcm/v201109">
<ns2:developerToken xmlns:ns2="
https://adwords.google.com/api/adwords/cm/v201109">XXXXXXXXXXXXXXXXXXXXXXXXXX</ns2:developerToken>
<ns2:userAgent xmlns:ns2="
https://adwords.google.com/api/adwords/cm/v201109">
AwApi-Python-15.1.4|Test Client</ns2:userAgent>
<ns2:authToken xmlns:ns2="
https://adwords.google.com/api/adwords/cm/v201109">
X</ns2:authToken>
</ns1:RequestHeader>
</ns0:Header>
<ns0:Body>
<ns1:get xmlns:ns1="
https://adwords.google.com/api/adwords/mcm/v201109">
<ns1:selector ns2:type="mcm:ServicedAccountSelector" xmlns:ns2="
http://www.w3.org/2001/XMLSchema-instance">
<ns1:enablePaging>false</ns1:enablePaging>
</ns1:selector>
</ns1:get>
</ns0:Body>
</ns0:Envelope>
************************************************************************
*** Incoming HTTP headers **********************************************
HTTP/1.? 200 OK
Content-Type: text/xml; charset=UTF-8
Content-Encoding: gzip
Date: Tue, 17 Jan 2012 19:16:21 GMT
Expires: Tue, 17 Jan 2012 19:16:21 GMT
Cache-Control: private, max-age=0
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
Content-Length: 337
Server: GSE
************************************************************************
*** Incoming SOAP ******************************************************
<?xml version='1.0' encoding='UTF-8'?>
<ns0:Envelope xmlns:ns0="
http://schemas.xmlsoap.org/soap/envelope/">
<ns0:Header>
<ns1:ResponseHeader xmlns:ns1="
https://adwords.google.com/api/adwords/mcm/v201109">
<ns2:requestId xmlns:ns2="
https://adwords.google.com/api/adwords/cm/v201109">
0004b6be2a9536900aecc56700001ab6</ns2:requestId>
<ns2:serviceName xmlns:ns2="
https://adwords.google.com/api/adwords/cm/v201109">ServicedAccountService</ns2:serviceName>
<ns2:methodName xmlns:ns2="
https://adwords.google.com/api/adwords/cm/v201109"
>get</ns2:methodName>
<ns2:operations xmlns:ns2="
https://adwords.google.com/api/adwords/cm/v201109"
>0</ns2:operations>
<ns2:responseTime xmlns:ns2="
https://adwords.google.com/api/adwords/cm/v201109">49</ns2:responseTime>
<ns2:units xmlns:ns2="
https://adwords.google.com/api/adwords/cm/v201109">0</n
s2:units>
</ns1:ResponseHeader>
</ns0:Header>
<ns0:Body>
<ns1:getResponse xmlns:ns1="
https://adwords.google.com/api/adwords/mcm/v201109">
<ns1:rval>
<ns1:accounts>
<ns1:customerId>0</ns1:customerId>
<ns1:canManageClients>false</ns1:canManageClients>
</ns1:accounts>
</ns1:rval>
</ns1:getResponse>
</ns0:Body>
</ns0:Envelope>
************************************************************************
EndTime: 2012-01-17 14:16:21
[2012-01-17 14:16:21,618::DEBUG::AwApi-Python-15.1.4] host=
adwords.google.com se
rvice=ServicedAccountService method=get operator=None responseTime=49 operations
=0 units=0 requestId=0004b6be2a9536900aecc56700001ab6 isFault=False
Login, CustomerId (Status)
{'canManageClients': 'false', 'customerId': '0'}
Usage: 0 units, 0 operations