Campaign service selector in v201003 using python library 12.1.0

35 views
Skip to first unread message

mmrs151

unread,
Sep 7, 2010, 11:29:46 AM9/7/10
to AdWords API Forum, api.sg...@gmail.com
I am trying the following code in the python terminal as you have
stated in the get_all_campaigns.py using latest python library 12.1.0
for v201003,
import os
import sys
sys.path.append(os.path.join('..', '..', '..', '..'))

from adspygoogle.adwords.AdWordsClient import AdWordsClient
client = AdWordsClient(path=os.path.join('..', '..', '..', '..'))
campaign_service = client.GetCampaignService('https://adwords-
sandbox.google.com', 'v201003')

selector = {}
campaigns = campaign_service.Get(selector)[0]

in this point it gives me the following error,
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/adspygoogle/adwords/CampaignService.py",
line 83, in Get
'Campaign', self._loc, request)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/adspygoogle/adwords/AdWordsWebService.py",
line 252, in CallMethod
self.__ManageSoap(buf, start_time, stop_time, error)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/
lib/python2.6/site-packages/adspygoogle/adwords/AdWordsWebService.py",
line 130, in __ManageSoap
raise Error(e)
adspygoogle.common.Errors.Error

I think its something to do with selector but don't have a clue about
the fix.

AdWords API Advisor

unread,
Sep 8, 2010, 2:10:32 AM9/8/10
to AdWords API Forum
Hi,

http://code.google.com/p/google-api-adwords-python-lib/source/browse/trunk/tests/campaign_service_unittest.py#340
and http://code.google.com/p/google-api-adwords-python-lib/source/browse/trunk/tests/campaign_service_unittest.py#361
shows how to use selectors with campaign service. Can you have a look
and see if you are constructing your selectors as shown in those test
cases?

Cheers,
Anash P Oommen,
AdWords API Advisor.
Reply all
Reply to author
Forward
0 new messages