Re: AdWords API Cannot access client library in python

2010-03-23 Thread khelll
I'm using this in python and it works great for me:

# Initialize client object.
headers = {
'email': 'some_em...@gmail.com',
'password': 'mylovleypass',
'userAgent': 'Fetcher',
'clientEmail': 'client_1+some_em...@gmail.com',
'developerToken': 'some_em...@gmail.com++usd',
'validateOnly': 'n'
}


client = Client(headers=headers)


Things works smoothly after that:

campaign_service = client.GetCampaignService(
'https://adwords-sandbox.google.com', 'v200909')

# Construct selector and get all campaigns.
selector = {}
campaigns = campaign_service.Get(selector)[0]

# Display results.
if 'entries' in campaigns:
  for campaign in campaigns['entries']:
print ('Campaign with id \'%s\', name \'%s\', and status \'%s\'
was found.'
   % (campaign['id'], campaign['name'], campaign['status']))
else:
  print 'No campaigns were found.'

print
print ('Usage: %s units, %s operations' % (client.GetUnits(),
   client.GetOperations()))


On Mar 23, 8:13 am, dsay  wrote:
> Moreover the link that you have provided is for v12. Will it be same
> for v2009?
>
> On Mar 23, 7:27 am, AdWords API Advisor 
> wrote:
>
> > Hi,
>
> > This error is being returned because the header values you are using
> > are not valid for the sandbox.  More information on how to set headers
> > in the sandbox is available here:
>
> >  http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbo...
> >  http://www.youtube.com/watch?v=cqVtUdB975M
>
> > Best,
> > - Eric Koleda, AdWords API Team
>
> > On Mar 20, 3:10 pm, dsay  wrote:
>
> > >         adwordsGoogleHeader = {}
> > >         adwordsGoogleHeader['applicationToken'] =
> > > Types.untypedType('TOK')
> > >         adwordsGoogleHeader['authToken'] = Types.untypedType('TOK')
> > >         adwordsGoogleHeader['clientEmail'] =
> > > Types.untypedType('EMAIL')
> > >         adwordsGoogleHeader['developerToken'] =
> > > Types.untypedType('TOK')
> > >         adwordsGoogleHeader['userAgent'] = Types.untypedType('UA')
> > >         adwordsGoogleHeader['validateOnly'] = Types.untypedType('1')
>
> > >         adwordsGoogleHeaderHOLD = Types.headerType()
>
> > > adwordsGoogleHeaderHOLD._addItem('RequestHeader',adwordsGoogleHeader)
> > >         #adwordsGoogleHeaderHOLD.__ns = 'https://adwords.google.com/
> > > api/adwords/cm/v200909'
> > >         adwordsGoogleHeaderHOLD._setAttr(
> > >           'xmlns',
> > >           'https://adwords.google.com/api/adwords/cm/v200909')
>
> > > On Mar 19, 11:41 pm, "Joshua J. Kugler"  wrote:
>
> > > > On Friday 19 March 2010,dsayelucidated thus:
>
> > > > > I am not sure if someone is able to use client library for python as
> > > > > I continue to get the following error
>
> > > > > Traceback (most recent call last):
> > > > >   File "get_related_keywords.py", line 53, in 
> > > > >     page = targeting_idea_service.Get(selector)[0]
> > > > >   File "../../aw_api/TargetingIdeaService.py", line 105, in Get
> > > > >     'TargetingIdea', self.__loc, request)
> > > > >   File "../../aw_api/WebService.py", line 350, in CallMethod
> > > > >     raise ValidationError(error['data'])
> > > > > aw_api.Errors.ValidationError: Invalid headers for 'https://adwords-
> > > > > sandbox.google.com', see
> > > > >http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbo
> > > > >x.html#requestheaders.
>
> > > > > I have tried to run in python 2.5 and 2.6 and on ubuntu and fedora.
> > > > > Its giving same error everywhere.
>
> > > > What code are you using to set your headers?
>
> > > > j
>
> > > > --
> > > > Joshua Kugler
> > > > Part-Time System Admin/Programmerhttp://www.eeinternet.com
> > > > PGP Key:http://pgp.mit.edu/ID0x73B13B6A

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

To unsubscribe from this group, send email to 
adwords-api+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: AdWords API Cannot access client library in python

2010-03-22 Thread dsay
Moreover the link that you have provided is for v12. Will it be same
for v2009?

On Mar 23, 7:27 am, AdWords API Advisor 
wrote:
> Hi,
>
> This error is being returned because the header values you are using
> are not valid for the sandbox.  More information on how to set headers
> in the sandbox is available here:
>
>  http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbo...
>  http://www.youtube.com/watch?v=cqVtUdB975M
>
> Best,
> - Eric Koleda, AdWords API Team
>
> On Mar 20, 3:10 pm, dsay  wrote:
>
> >         adwordsGoogleHeader = {}
> >         adwordsGoogleHeader['applicationToken'] =
> > Types.untypedType('TOK')
> >         adwordsGoogleHeader['authToken'] = Types.untypedType('TOK')
> >         adwordsGoogleHeader['clientEmail'] =
> > Types.untypedType('EMAIL')
> >         adwordsGoogleHeader['developerToken'] =
> > Types.untypedType('TOK')
> >         adwordsGoogleHeader['userAgent'] = Types.untypedType('UA')
> >         adwordsGoogleHeader['validateOnly'] = Types.untypedType('1')
>
> >         adwordsGoogleHeaderHOLD = Types.headerType()
>
> > adwordsGoogleHeaderHOLD._addItem('RequestHeader',adwordsGoogleHeader)
> >         #adwordsGoogleHeaderHOLD.__ns = 'https://adwords.google.com/
> > api/adwords/cm/v200909'
> >         adwordsGoogleHeaderHOLD._setAttr(
> >           'xmlns',
> >           'https://adwords.google.com/api/adwords/cm/v200909')
>
> > On Mar 19, 11:41 pm, "Joshua J. Kugler"  wrote:
>
> > > On Friday 19 March 2010,dsayelucidated thus:
>
> > > > I am not sure if someone is able to use client library for python as
> > > > I continue to get the following error
>
> > > > Traceback (most recent call last):
> > > >   File "get_related_keywords.py", line 53, in 
> > > >     page = targeting_idea_service.Get(selector)[0]
> > > >   File "../../aw_api/TargetingIdeaService.py", line 105, in Get
> > > >     'TargetingIdea', self.__loc, request)
> > > >   File "../../aw_api/WebService.py", line 350, in CallMethod
> > > >     raise ValidationError(error['data'])
> > > > aw_api.Errors.ValidationError: Invalid headers for 'https://adwords-
> > > > sandbox.google.com', see
> > > >http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbo
> > > >x.html#requestheaders.
>
> > > > I have tried to run in python 2.5 and 2.6 and on ubuntu and fedora.
> > > > Its giving same error everywhere.
>
> > > What code are you using to set your headers?
>
> > > j
>
> > > --
> > > Joshua Kugler
> > > Part-Time System Admin/Programmerhttp://www.eeinternet.com
> > > PGP Key:http://pgp.mit.edu/ID0x73B13B6A

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

To unsubscribe from this group, send email to 
adwords-api+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: AdWords API Cannot access client library in python

2010-03-22 Thread dsay
Sorry the code was for direct calls using SOAPpy.

The error is coming from simply invoking the client library
get_related_keywords.py after providing the config details in config
file.

On Mar 23, 7:27 am, AdWords API Advisor 
wrote:
> Hi,
>
> This error is being returned because the header values you are using
> are not valid for the sandbox.  More information on how to set headers
> in the sandbox is available here:
>
>  http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbo...
>  http://www.youtube.com/watch?v=cqVtUdB975M
>
> Best,
> - Eric Koleda, AdWords API Team
>
> On Mar 20, 3:10 pm, dsay  wrote:
>
> >         adwordsGoogleHeader = {}
> >         adwordsGoogleHeader['applicationToken'] =
> > Types.untypedType('TOK')
> >         adwordsGoogleHeader['authToken'] = Types.untypedType('TOK')
> >         adwordsGoogleHeader['clientEmail'] =
> > Types.untypedType('EMAIL')
> >         adwordsGoogleHeader['developerToken'] =
> > Types.untypedType('TOK')
> >         adwordsGoogleHeader['userAgent'] = Types.untypedType('UA')
> >         adwordsGoogleHeader['validateOnly'] = Types.untypedType('1')
>
> >         adwordsGoogleHeaderHOLD = Types.headerType()
>
> > adwordsGoogleHeaderHOLD._addItem('RequestHeader',adwordsGoogleHeader)
> >         #adwordsGoogleHeaderHOLD.__ns = 'https://adwords.google.com/
> > api/adwords/cm/v200909'
> >         adwordsGoogleHeaderHOLD._setAttr(
> >           'xmlns',
> >           'https://adwords.google.com/api/adwords/cm/v200909')
>
> > On Mar 19, 11:41 pm, "Joshua J. Kugler"  wrote:
>
> > > On Friday 19 March 2010,dsayelucidated thus:
>
> > > > I am not sure if someone is able to use client library for python as
> > > > I continue to get the following error
>
> > > > Traceback (most recent call last):
> > > >   File "get_related_keywords.py", line 53, in 
> > > >     page = targeting_idea_service.Get(selector)[0]
> > > >   File "../../aw_api/TargetingIdeaService.py", line 105, in Get
> > > >     'TargetingIdea', self.__loc, request)
> > > >   File "../../aw_api/WebService.py", line 350, in CallMethod
> > > >     raise ValidationError(error['data'])
> > > > aw_api.Errors.ValidationError: Invalid headers for 'https://adwords-
> > > > sandbox.google.com', see
> > > >http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbo
> > > >x.html#requestheaders.
>
> > > > I have tried to run in python 2.5 and 2.6 and on ubuntu and fedora.
> > > > Its giving same error everywhere.
>
> > > What code are you using to set your headers?
>
> > > j
>
> > > --
> > > Joshua Kugler
> > > Part-Time System Admin/Programmerhttp://www.eeinternet.com
> > > PGP Key:http://pgp.mit.edu/ID0x73B13B6A

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

To unsubscribe from this group, send email to 
adwords-api+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: AdWords API Cannot access client library in python

2010-03-22 Thread AdWords API Advisor
Hi,

This error is being returned because the header values you are using
are not valid for the sandbox.  More information on how to set headers
in the sandbox is available here:

  
http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbox.html#requestheaders
  http://www.youtube.com/watch?v=cqVtUdB975M

Best,
- Eric Koleda, AdWords API Team

On Mar 20, 3:10 pm, dsay  wrote:
>         adwordsGoogleHeader = {}
>         adwordsGoogleHeader['applicationToken'] =
> Types.untypedType('TOK')
>         adwordsGoogleHeader['authToken'] = Types.untypedType('TOK')
>         adwordsGoogleHeader['clientEmail'] =
> Types.untypedType('EMAIL')
>         adwordsGoogleHeader['developerToken'] =
> Types.untypedType('TOK')
>         adwordsGoogleHeader['userAgent'] = Types.untypedType('UA')
>         adwordsGoogleHeader['validateOnly'] = Types.untypedType('1')
>
>         adwordsGoogleHeaderHOLD = Types.headerType()
>
> adwordsGoogleHeaderHOLD._addItem('RequestHeader',adwordsGoogleHeader)
>         #adwordsGoogleHeaderHOLD.__ns = 'https://adwords.google.com/
> api/adwords/cm/v200909'
>         adwordsGoogleHeaderHOLD._setAttr(
>           'xmlns',
>           'https://adwords.google.com/api/adwords/cm/v200909')
>
> On Mar 19, 11:41 pm, "Joshua J. Kugler"  wrote:
>
>
>
> > On Friday 19 March 2010,dsayelucidated thus:
>
> > > I am not sure if someone is able to use client library for python as
> > > I continue to get the following error
>
> > > Traceback (most recent call last):
> > >   File "get_related_keywords.py", line 53, in 
> > >     page = targeting_idea_service.Get(selector)[0]
> > >   File "../../aw_api/TargetingIdeaService.py", line 105, in Get
> > >     'TargetingIdea', self.__loc, request)
> > >   File "../../aw_api/WebService.py", line 350, in CallMethod
> > >     raise ValidationError(error['data'])
> > > aw_api.Errors.ValidationError: Invalid headers for 'https://adwords-
> > > sandbox.google.com', see
> > >http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbo
> > >x.html#requestheaders.
>
> > > I have tried to run in python 2.5 and 2.6 and on ubuntu and fedora.
> > > Its giving same error everywhere.
>
> > What code are you using to set your headers?
>
> > j
>
> > --
> > Joshua Kugler
> > Part-Time System Admin/Programmerhttp://www.eeinternet.com
> > PGP Key:http://pgp.mit.edu/ID0x73B13B6A

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

To unsubscribe from this group, send email to 
adwords-api+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: AdWords API Cannot access client library in python

2010-03-20 Thread dsay
adwordsGoogleHeader = {}
adwordsGoogleHeader['applicationToken'] =
Types.untypedType('TOK')
adwordsGoogleHeader['authToken'] = Types.untypedType('TOK')
adwordsGoogleHeader['clientEmail'] =
Types.untypedType('EMAIL')
adwordsGoogleHeader['developerToken'] =
Types.untypedType('TOK')
adwordsGoogleHeader['userAgent'] = Types.untypedType('UA')
adwordsGoogleHeader['validateOnly'] = Types.untypedType('1')

adwordsGoogleHeaderHOLD = Types.headerType()
 
adwordsGoogleHeaderHOLD._addItem('RequestHeader',adwordsGoogleHeader)
#adwordsGoogleHeaderHOLD.__ns = 'https://adwords.google.com/
api/adwords/cm/v200909'
adwordsGoogleHeaderHOLD._setAttr(
  'xmlns',
  'https://adwords.google.com/api/adwords/cm/v200909')

On Mar 19, 11:41 pm, "Joshua J. Kugler"  wrote:
> On Friday 19 March 2010,dsayelucidated thus:
>
>
>
> > I am not sure if someone is able to use client library for python as
> > I continue to get the following error
>
> > Traceback (most recent call last):
> >   File "get_related_keywords.py", line 53, in 
> >     page = targeting_idea_service.Get(selector)[0]
> >   File "../../aw_api/TargetingIdeaService.py", line 105, in Get
> >     'TargetingIdea', self.__loc, request)
> >   File "../../aw_api/WebService.py", line 350, in CallMethod
> >     raise ValidationError(error['data'])
> > aw_api.Errors.ValidationError: Invalid headers for 'https://adwords-
> > sandbox.google.com', see
> >http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbo
> >x.html#requestheaders.
>
> > I have tried to run in python 2.5 and 2.6 and on ubuntu and fedora.
> > Its giving same error everywhere.
>
> What code are you using to set your headers?
>
> j
>
> --
> Joshua Kugler
> Part-Time System Admin/Programmerhttp://www.eeinternet.com
> PGP Key:http://pgp.mit.edu/ID 0x73B13B6A

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

To unsubscribe from this group, send email to 
adwords-api+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: AdWords API Cannot access client library in python

2010-03-19 Thread Joshua J. Kugler
On Friday 19 March 2010, dsay elucidated thus:
> I am not sure if someone is able to use client library for python as
> I continue to get the following error
>
> Traceback (most recent call last):
>   File "get_related_keywords.py", line 53, in 
> page = targeting_idea_service.Get(selector)[0]
>   File "../../aw_api/TargetingIdeaService.py", line 105, in Get
> 'TargetingIdea', self.__loc, request)
>   File "../../aw_api/WebService.py", line 350, in CallMethod
> raise ValidationError(error['data'])
> aw_api.Errors.ValidationError: Invalid headers for 'https://adwords-
> sandbox.google.com', see
> http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbo
>x.html#requestheaders.
>
>
> I have tried to run in python 2.5 and 2.6 and on ubuntu and fedora.
> Its giving same error everywhere.

What code are you using to set your headers?

j

-- 
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/  ID 0x73B13B6A

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

To unsubscribe from this group, send email to 
adwords-api+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


AdWords API Cannot access client library in python

2010-03-19 Thread dsay
I am not sure if someone is able to use client library for python as I
continue to get the following error

Traceback (most recent call last):
  File "get_related_keywords.py", line 53, in 
page = targeting_idea_service.Get(selector)[0]
  File "../../aw_api/TargetingIdeaService.py", line 105, in Get
'TargetingIdea', self.__loc, request)
  File "../../aw_api/WebService.py", line 350, in CallMethod
raise ValidationError(error['data'])
aw_api.Errors.ValidationError: Invalid headers for 'https://adwords-
sandbox.google.com', see 
http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbox.html#requestheaders.


I have tried to run in python 2.5 and 2.6 and on ubuntu and fedora.
Its giving same error everywhere.

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Have you migrated to v200909 yet?
The v13 sunset is on April 22, 2010.

Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

To unsubscribe from this group, send email to 
adwords-api+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.