剛開始使用Adwords API時,出於某種原因,我似乎根本無法連接。Google Adwords API身份驗證問題
下面的代碼,直接從教程引發錯誤:
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
client = AdWordsClient(path=os.path.join('Users', 'ravinthambapillai', 'Google Drive', 'client_secrets.json'))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/adspygoogle/adwords/AdWordsClient.py", line 151, in __init__
self._headers = self.__LoadAuthCredentials()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/adspygoogle/adwords/AdWordsClient.py", line 223, in __LoadAuthCredentials
return super(AdWordsClient, self)._LoadAuthCredentials()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/adspygoogle/common/Client.py", line 94, in _LoadAuthCredentials
raise ValidationError(msg)
**ValidationError: Authentication data is missing.**
from adspygoogle.adwords.AdWordsClient import AdWordsClient
from adspygoogle.common import Utils
client = AdWordsClient(path=os.path.join('Users', 'this-user', 'this-folder', 'client_secrets.json'))
多利安:這裏的CLIENT_CUSTOMER_ID是一個變量。這個價值是否應該由客戶提供,還是被視爲保密價值? – 2013-07-11 18:09:06
'client_customer_id'只是您想要訪問的Google AdWords帳戶的ID(「123-456-7890」)。 AFAIR可以忽略此參數,在這種情況下,您將訪問連接到您的Google帳戶的頂級Adwords帳戶。 – dorian 2013-07-12 13:12:58