Adwords API Call - Client Customer ID (Python)

1,187 views
Skip to first unread message

Clarissa

unread,
Oct 3, 2017, 5:22:19 PM10/3/17
to AdWords API Forum
Two Issues here I think.

1) WARNING:googleads.common:Your default encoding, cp1252, is not UTF-8. Please run this script with UTF-8 encoding to avoid errors

How can I fix this? I'm using python 2.7.14 if that is helpful?

2)[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:'<null>']'

I have the client customer ID included in my google.yaml file so I'm not sure why I can't authenticate. 








C:\Python27\python.exe C:/Users/clarissa.diaz/PythonProjects/googleads-python-lib-master/googleads-python-lib-master/examples/adwords/v201708/basic_operations/get_campaigns.py
WARNING:googleads.common:Your default encoding, cp1252, is not UTF-8. Please run this script with UTF-8 encoding to avoid errors.
INFO:oauth2client.client:Refreshing access_token
INFO:googleads.common:Request summary - {'methodName': get}
DEBUG:suds.transport.http:sending:
HEADERS: {'Soapaction': '""', 'Content-Type': 'text/xml; charset=utf-8', 'Content-type': 'text/xml; charset=utf-8', 'Authorization': 'REDACTED', 'SOAPAction': '""'}
MESSAGE:
<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201708" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="https://adwords.google.com/api/adwords/cm/v201708" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><tns:RequestHeader><tns:developerToken>REDACTED</tns:developerToken><tns:userAgent>unknown (AwApi-Python, googleads/8.0.0, Python/2.7.14)</tns:userAgent><tns:validateOnly>false</tns:validateOnly><tns:partialFailure>false</tns:partialFailure></tns:RequestHeader></SOAP-ENV:Header><ns0:Body><ns1:get><ns1:serviceSelector><ns1:fields>Id</ns1:fields><ns1:fields>Name</ns1:fields><ns1:fields>Status</ns1:fields><ns1:paging><ns1:startIndex>0</ns1:startIndex><ns1:numberResults>100</ns1:numberResults></ns1:paging></ns1:serviceSelector></ns1:get></ns0:Body></SOAP-ENV:Envelope>
INFO:googleads.common:Response summary - {'operations': 1, 'methodName': get, 'faultMessage': u"[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:'<null>']", 'isFault': True, 'requestId': 00055aa73fdd72c80a01648ef40e5b91, 'responseTime': 53, 'serviceName': CampaignService}
ERROR:suds.client:<suds.sax.document.Document instance at 0x03FD70A8>
WARNING:googleads.common:Response summary - {'operations': 1, 'methodName': get, 'faultMessage': u"[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:'<null>']", 'isFault': True, 'requestId': 00055aa73fdd72c80a01648ef40e5b91, 'responseTime': 53, 'serviceName': CampaignService}
INFO:googleads.common:SOAP response:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Header>
      <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201708">
         <requestId>00055aa73fdd72c80a01648ef40e5b91</requestId>
         <serviceName>CampaignService</serviceName>
         <methodName>get</methodName>
         <operations>1</operations>
         <responseTime>53</responseTime>
      </ResponseHeader>
   </soap:Header>
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:&apos;&lt;null&gt;&apos;]</faultstring>
         <detail>
            <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201708">
               <message>[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:&apos;&lt;null&gt;&apos;]</message>
               <ApplicationException.Type>ApiException</ApplicationException.Type>
               <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AuthenticationError">
                  <fieldPath/>
                  <trigger>&lt;null&gt;</trigger>
                  <errorString>AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED</errorString>
                  <ApiError.Type>AuthenticationError</ApiError.Type>
                  <reason>CLIENT_CUSTOMER_ID_IS_REQUIRED</reason>
               </errors>
            </ApiExceptionFault>
         </detail>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>
Traceback (most recent call last):
  File "C:/Users/clarissa.diaz/PythonProjects/googleads-python-lib-master/googleads-python-lib-master/examples/adwords/v201708/basic_operations/get_campaigns.py", line 74, in <module>
    main(adwords_client)
  File "C:/Users/clarissa.diaz/PythonProjects/googleads-python-lib-master/googleads-python-lib-master/examples/adwords/v201708/basic_operations/get_campaigns.py", line 56, in main
    page = campaign_service.get(selector)
  File "build\bdist.win32\egg\googleads\common.py", line 753, in MakeSoapRequest
  File "build\bdist.win32\egg\suds\client.py", line 521, in __call__
  File "build\bdist.win32\egg\suds\client.py", line 581, in invoke
  File "build\bdist.win32\egg\suds\client.py", line 619, in send
  File "build\bdist.win32\egg\suds\client.py", line 670, in process_reply
suds.WebFault: Server raised fault: '[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:'<null>']'

Process finished with exit code 1

Peter Oliquino

unread,
Oct 4, 2017, 2:02:38 AM10/4/17
to AdWords API Forum
Hi Clarissa,

For your first question, kindly get in touch with the Python library owners via this link as they are more equipped to assist you regarding this. As for your second question, it seems that the clientCustomerId is not being included in your request header.

This being said, could you confirm if you have configured your client library as discussed here and that you specified the client account ID and removed the '#' in the client_customer_id property?

Thanks and regards,
Peter
AdWords API Team

Peter Oliquino

unread,
Oct 16, 2017, 4:31:36 AM10/16/17
to AdWords API Forum
Hi Clarissa,

I wanted to follow up on this issue that you encountered. Were you already able to find a solution? If you still have any AdWords API related issues let me know so I can provide assistance.

akhil...@associates.scit.edu

unread,
Apr 30, 2018, 12:46:47 PM4/30/18
to AdWords API and Google Ads API Forum
Hi Peter,

I have followed all the steps mentioned in the link. Yet no luck with the error. Please let me know if you need additional information. I'm using the sample code get_campaigns.py.

Regards,
Akhil Nair

Dhanya Sundararaju (AdWords API Team)

unread,
Apr 30, 2018, 1:51:18 PM4/30/18
to AdWords API and Google Ads API Forum
Hi Akhil,

Could you please reply privately to author with your complete SOAP logs and your googleads.yaml file with data NOT redacted so that I can troubleshoot further? 

Regards,
Dhanya, AdWords API Team
Reply all
Reply to author
Forward
0 new messages