QuotaCheckError.INVALID_TOKEN_HEADER。如何检查是什么问题?

QuotaCheckError.INVALID_TOKEN_HEADER. How to check what the issue is?

我正在尝试 运行 get_campaigns.py 示例代码。我使用正确的 client_idclient_secretrefresh_token 创建了 adwords 客户端对象。然而,当我 运行 它时,我得到了以

结尾的回溯

Server raised fault: '[QuotaCheckError.INVALID_TOKEN_HEADER @ ; trigger:'6Ji***developer-token****Yg']'

当我向上滚动日志时,我看到记录了 HEADERS,但他们没有提到任何 developerToken 本应如此,根据 this guide

URL: https://adwords.google.com/api/adwords/cm/v201605/CampaignService

HEADERS: {'Soapaction': b'""', 'Content-Type': 'text/xml; charset=utf-8', 'Content-type': 'text/xml; charset=utf-8', 'Authorization': 'Bearer ya2***access_token***194f3g', 'SOAPAction': b'""'}

MESSAGE: b'<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:tns="https://adwords.google.com/api/adwords/cm/v201605" xmlns:ns1="https://adwords.google.com/api/adwords/cm/v201605" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header><tns:RequestHeader><tns:clientCustomerId>659-360-1388</tns:clientCustomerId><tns:developerToken>6Ji***developer-token****Yg</tns:developerToken><tns:userAgent>MYM (AwApi-Python, googleads/4.2.0, Python/3.5.1)</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@mydomain.com,而 client_idclient_secret 是使用 reporting+testaccount@mydomain.com 创建,这是我为测试 API 创建的测试经理帐户。这也会产生问题吗?此外,developer_token 现在处于 test_account 状态。

你能告诉我我做错了什么吗?在过去的 5 天里,我一直在为这个问题而苦苦挣扎。如果 Python 客户端库没有得到很好的支持,请告诉我推荐的平台是什么,以便我可以切换到它。预先感谢您的所有帮助!

这是因为将开发人员令牌复制到我的代码时出错。您可以在 Google 群组阅读讨论 - https://groups.google.com/forum/#!topic/adwords-api/V4oaXBgEm8k