Authorization in v13 is successful, in v200906 fails (AuthorizationError.USER_PERMISSION_DENIED)

100 views
Skip to first unread message

Ales Sturala

unread,
Nov 24, 2009, 4:45:35 PM11/24/09
to AdWords API Forum
Hello,
I get into troubles with the API v200906 (.NET) when trying to access
an account in production environment.

When any operation is called I get an exception:
AuthorizationError.USER_PERMISSION_DENIED @

I've spent several hours figuring out what is wrong with the given
credentials or with permissions but still getting the same error. Then
I tried to use the v13 service instead of v200906 and everything
worked properly.

So the question is why when using v13 the operations are executed but
when using v200906 then I get the permission denied error?

We already migrated our tools to v200906 but we've always run it only
in a sandbox (because of some problems with the v2006) and the
"sandbox" authentication works allright, so that's why I think that
it's connected only to the production environment.

Here is piece of code demonstrating the issue:

var csrv13 = (com.google.api.adwords.v13.CampaignService)
adwordsUser.GetService(ApiServices.v13.CampaignService);

var cc13 = csrv13.getAllAdWordsCampaigns(0);

// ^^ variable cc13 contains all campaigns


var csrv2009 =
(com.google.api.adwords.v200906.CampaignService.CampaignService)
adwordsUser.GetService
(ApiServices.v200906.CampaignService);


com.google.api.adwords.v200906.CampaignService.CampaignSelector sel =
new com.google.api.adwords.v200906.CampaignService.CampaignSelector();

var cc2009 = csrv2009.get(sel);

// ^^ throws the exception AuthorizationError.USER_PERMISSION_DENIED @

AdWords API Advisor

unread,
Nov 24, 2009, 5:10:40 PM11/24/09
to AdWords API Forum
Hi,

Can you double check that you are using the correct credentials of
your AdWords account or MCC account to generate the authToken? Do you
have the request ID for a request that demonstrates this issue?

Best,
- Eric Koleda, AdWords API Team

Ales Sturala

unread,
Nov 24, 2009, 5:51:48 PM11/24/09
to AdWords API Forum
Hello,
The piece of code is called together, both campaign services v2006 and
v13 are using the same instantiation of AdWordsUser, so same
credentials. At first it uses the v13 and it works, and right after
that instantiates the v2006 campaign service and then using it fails.
So I really don't think it's wrong credentials, unless I have to
enable somehow the v2006 for the client.

I don't have request ID, how do I get it? Do I have to enable logging
of the AdWords API and then can I find it there?

On Nov 24, 11:10 pm, AdWords API Advisor

AdWords API Advisor

unread,
Nov 24, 2009, 6:31:04 PM11/24/09
to AdWords API Forum
Hi,

Ok, I see now. If it uses the same AdWordsUser than the credentials
are the same. All accounts have permission to use the v2009 API
automatically.

The request ID is returned in the ResponseHeader of the SOAP XML
response. If you enable logging in the client library it will be easy
to see this value.

Best,
- Eric

Ales Sturala

unread,
Nov 24, 2009, 6:40:53 PM11/24/09
to AdWords API Forum
Ok, it seems the problem is in the .NET library. I don't use the
configuration file in this project and enter all the data in the code
instead.
When I tried to enable logging, I added the web.config file and added
some of the configuration elements AdWords uses and the v2009 api
calls suddenly works.

Even if the configuration file contain empty configuration elements it
works, it's enough to add this:
...
<configSections>
<section name="AdWordsApi"
type="com.google.api.adwords.lib.ApplicationConfiguration,google-api-
adwords-dotnet"/>
</configSections>

<AdWordsApi>
</AdWordsApi>

As you can see AdWordsApi is empty still it obviously makes a
difference because without it the
AuthorizationError.USER_PERMISSION_DENIED is returned, so seems it's a
bug in the v200906 version. The v13 is not affected by this issue.


Regards,
Ales



On Nov 25, 12:31 am, AdWords API Advisor

AdWords API Advisor

unread,
Nov 25, 2009, 9:06:07 AM11/25/09
to AdWords API Forum
Hi Ales,

I'm glad you were able to isolate the issue. If you believe there is
a bug in the AdWords API .NET Client Library please submit a report on
the issue tracker: http://code.google.com/p/google-api-adwords-dotnet/issues/list.

Best,
- Eric
Reply all
Reply to author
Forward
0 new messages