CustomerService getCustomers() throws CUSTOMER_NOT_FOUND

32 views
Skip to first unread message

Ivan Petrushev

unread,
Aug 26, 2019, 7:25:24 PM8/26/19
to AdWords API and Google Ads API Forum
Hello,

I am trying to get information about the directly authorized user. 
API docs state calling CustomerService.getCustomers() can be used without clientCustomerId, but if I try to do it, I get this error:
> AuthenticationError.CUSTOMER_NOT_FOUND

I am using Python client library:
client = adwords.AdWordsClient(developer_token, oauth2_client, cache=googleads.common.ZeepServiceProxy.NO_CACHE)
customers = client.GetService('CustomerService', version='v201809').getCustomers()

This is the outgoing SOAP request:
{'SOAPAction': '\"\"', 'Content-Type': 'text/xml; charset=utf-8', 'authorization': 'REDACTED'}\n

<soap-env:Envelope
<soap-env:Header>\n    
<ns0:RequestHeader
<ns1:developerToken
</ns1:developerToken>\n      
<ns2:userAgent
xmlns:ns2=\"https://adwords.google.com/api/adwords/cm/v201809\">unknown (AwApi-Python, googleads/18.1.0, Python/3.7.3, zeep)
</ns2:userAgent>\n      
<ns3:validateOnly
</ns3:validateOnly>\n      
<ns4:partialFailure
</ns4:partialFailure>\n    
</ns0:RequestHeader>\n  
</soap-env:Header>\n  
<soap-env:Body>\n    
<ns0:getCustomers
</soap-env:Body>\n
</soap-env:Envelope>\n

And this is the response:

<soap:Envelope
<soap:Header>\\n    
<ResponseHeader
<ns2:requestId>000590c5fcc1335c0a1b99d657098956</ns2:requestId>\\n      
<ns2:serviceName>CustomerService</ns2:serviceName>\\n      
<ns2:methodName>getCustomers</ns2:methodName>\\n      
<ns2:operations>1</ns2:operations>\\n      
<ns2:responseTime>229</ns2:responseTime>\\n    
</ResponseHeader>\\n  
</soap:Header>\\n  
<soap:Body>\\n    
<soap:Fault>\\n      
<faultcode>soap:Server</faultcode>\\n      
<faultstring>[AuthenticationError.CUSTOMER_NOT_FOUND @ ]</faultstring>\\n      
<detail>\\n        
<ApiExceptionFault
xmlns:ns2=\"https://adwords.google.com/api/adwords/cm/v201809\">\\n          
<ns2:message>[AuthenticationError.CUSTOMER_NOT_FOUND @ ]</ns2:message>\\n          
<ns2:ApplicationException.Type>ApiException</ns2:ApplicationException.Type>\\n          
<ns2:errors
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:type=\"ns2:AuthenticationError\">\\n            
<ns2:fieldPath/>\\n            
<ns2:trigger/>\\n            
<ns2:errorString>AuthenticationError.CUSTOMER_NOT_FOUND</ns2:errorString>\\n            
<ns2:ApiError.Type>AuthenticationError</ns2:ApiError.Type>\\n            
<ns2:reason>CUSTOMER_NOT_FOUND</ns2:reason>\\n          
</ns2:errors>\\n        
</ApiExceptionFault>\\n      
</detail>\\n    
</soap:Fault>\\n  
</soap:Body>\\n
</soap:Envelope>\\n

DNH Soft OOD | Polk. Bonev St. 28 | 4003 Plovdiv, Bulgaria
MD: Chudomir Delchev | EID: 201796132 | VAT ID: BG201796132

Google Ads API Forum Advisor Prod

unread,
Aug 26, 2019, 11:03:28 PM8/26/19
to adwor...@googlegroups.com

Hi Ivan,

The CustomerService.getCustomers() when used without a clientCustomerId should return the accounts which the OAuth2 credentials has direct access to. When used with a clientCustomerId, it should return the details of that specific account only. That being said, could you confirm if the OAuth2 credentials you are using were generated using an email address which has access to an existing Google Ads account?

Additionally, so I can further investigate, could you provide your clientCustomerId and the email address you used to generate the credentials? You may send your reply using the Reply privately to author option.

Thanks and regards,
Peter
Google Ads API Team



ref:_00D1U1174p._5001UHEkaQ:ref
Reply all
Reply to author
Forward
0 new messages