views:

84

answers:

1

I get the following error when I try to run sample example of Google adwords

[root@some v200909]# python get_related_keywords.py 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. [root@some v200909]#

A: 

This sounds like an issue with the headers you're providing. The headers must be especially formatted for the sandbox, so make sure that:

a) You're formatting the headers as specified in http://code.google.com/apis/adwords/docs/developer/adwords_api_sandbox.html#requestheaders , as Goose Bumper mentioned. This applies to both v2009 and v13, as you still need to format the developer token and client email according to the instructions (the application token is now obsolete).

b) You're choosing the right endpoint, namely adwords-sandbox.google.com for v2009 and sandbox.google.com for v13

If this still doesn't work for you, the SOAP logs for your request might be useful.

Sérgio Gomes
get_related_keywords.py is a sample from google client lib, I am only executing it.
dhaval
This would indicate that the problem is a) in my post above. Did you run aw_api_config.py as per the Readme to set the authentication headers? Make sure you set them according to the special header format for the sandbox.
Sérgio Gomes