INVALID_TOKEN_HEADER while connecting to Ads API from Production website, testing website is working fine. How to find what is causing the issue?

60 views
Skip to first unread message

mku...@gmail.com

unread,
Jun 19, 2018, 5:47:02 AM6/19/18
to AdWords API and Google Ads API Forum
Hi,

we are having problem when we are trying to access Adwords API from our production website statusdroid.com. When I try to connect to the API, I am getting following error message.

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1300, in MakeSoapRequest
*packed_args, _soapheaders=soap_headers)['body']['rval']
File "/usr/local/lib/python3.6/site-packages/zeep/client.py", line 45, in __call__
self._op_name, args, kwargs)
File "/usr/local/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 121, in send
return self.process_reply(client, operation_obj, response)
File "/usr/local/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 186, in process_reply
return self.process_error(doc, operation)
File "/usr/local/lib/python3.6/site-packages/zeep/wsdl/bindings/soap.py", line 291, in process_error
detail=fault_node.find('detail'))
zeep.exceptions.Fault: [QuotaCheckError.INVALID_TOKEN_HEADER @ ] During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "/app/statusdroid/campaigns/utils.py", line 64, in sync_social_account
adwords.sync_google_campaigns(social_account)
File "/app/statusdroid/campaigns/adwords.py", line 73, in sync_google_campaigns
customerId = customer_service.getCustomers()[0]["customerId"]
File "/usr/local/lib/python3.6/site-packages/googleads/common.py", line 1312, in MakeSoapRequest
e.detail, errors=error_list, message=e.message)
googleads.errors.GoogleAdsServerFault: [QuotaCheckError.INVALID_TOKEN_HEADER @ ]

When I recreate the same steps on our testing website testing.statusdroid.com, I am able to access the API and connect the ads to our website. We are using 2 different tokens with the same API key. I was told that we cannot use the same token on production website and testing website. However we are unable to find what is causing the issue. 

Has anyone got any ideas please what may be the problem? If you have any questions or need more information, please do not hesitate to contact me. I'll be glad for any help.

Thank you.

Teja Makani

unread,
Jun 19, 2018, 1:00:04 PM6/19/18
to AdWords API and Google Ads API Forum
Hello Mirek,

INVALID_TOKEN_HEADER usually occurs when the developer token in the request is missing or invalid. Please make sure the developer token entered for production site has no typos and ensure that the developer token matches the value in the AdWords API Center. If you are still facing issues, you could share the developer token that you are using for production, the AdWords account CID for which the token is associated to and the complete SOAP logs(request and response). You could reply privately to the author while sharing. Also, please note that an approved developer token can be used to make API calls against any AdWords account(Test and Production). 

Regards,
Sai Teja, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages