how can i set account info&token In Python

23 views
Skip to first unread message

6910...@qq.com

unread,
Jan 25, 2016, 9:03:37 AM1/25/16
to AdWords API Forum
Hi,
Now i have a mcc API token,OAuth client iD,client secret,mcc login email.

i found a flie adwords_test.py

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

PYTHON2 = sys.version_info[0] == 2
URL_REQUEST_PATH = ('urllib2' if PYTHON2 else 'urllib.request')
CURRENT_VERSION = sorted(googleads.adwords._SERVICE_MAP.keys())[-1]


def GetAdWordsClient():
"""Returns an initialized AdwordsClient for use in testing."""
oauth_header = {'Authorization': 'header'}
client_customer_id = 'x'
dev_token = 'x'
user_agent = 'N3v3rG0nN4l37y0uDoWN'
oauth2_client = mock.Mock()
oauth2_client.CreateHttpHeader.return_value = dict(oauth_header)
client = googleads.adwords.AdWordsClient(
dev_token, oauth2_client, user_agent,
client_customer_id=client_customer_id)
return client
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if i enter the dev_token&client_customer_id,i will connect to the adwords mcc account,any other information should i add to the code

and what is oauth_header?

Yin Niu

unread,
Jan 25, 2016, 10:18:16 AM1/25/16
to AdWords API Forum
Hello, 

Please use AdWords client library for Python. There are sample code that you test with. 

Thanks,
Yin, AdWords API Team. 
Reply all
Reply to author
Forward
0 new messages