Authorization Error trouble

26 views
Skip to first unread message

Jonathan Walder

unread,
Nov 18, 2015, 8:40:49 AM11/18/15
to AdWords API Forum
We are trying to create some CRM based lists in AdWords via the API and are just getting started with it. We have run into an issue at the gates which is making it difficult to proceed. There appear to be no OAuth2 issues as we are not getting any "Authentication" errors, instead we are getting an "Authorization" error.

Details:
- The "ClientID" and associated "ClientSecret" are from a project under an account which has administrative permissions on the master.
- The "RefreshToken" was generated authorizing the same account as above to the AdWords scope.
- The "DeveloperToken" was generated on a different account under a different master which has basic API access.
- Using the C# GitHub managed code base for Google.Api.Ads.AdWords.v201509

ERROR: [AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'<null>']

Any insight on what could possibly be the issue here would be greatly appreciated.

This is the relevant portion of the code:

                // Get Auth First
                AdWordsUser awUser = new AdWordsUser();

                // Get the UserListService.
                AdwordsUserListService userListService =
                    (AdwordsUserListService)awUser.GetService(AdWordsService.v201509.AdwordsUserListService);

                #region AddUserList and Populate Test                
                // Create remarketing user list.
                CrmBasedUserList userList = new CrmBasedUserList()
                {
                    name = "Test List 1",
                    description = "A list of customers that originated from email addresses",
                    membershipLifeSpan = 365L,
                };
                UserListOperation ulistop = new UserListOperation()
                {
                    operand = userList,
                    @operator = Operator.ADD 
                };
                var ulo = new UserListOperation[] { ulistop };
                // Add user list.
                UserListReturnValue result = userListService.mutate(ulo); <====ERROR OCCURS HERE




Umesh Dengale

unread,
Nov 18, 2015, 2:31:00 PM11/18/15
to AdWords API Forum
Hello,

The AuthorizationError.USER_PERMISSION_DENIED means your OAuth credentials don't match clientCustomerId you specify. Basically, login you are using doesn't have access to the account you are trying to touch. BTW, this is covered here. Please re-do the OAuth flow (generate new refresh token) making sure you are logged in under a proper account(MCC account owner). Please check out OAuth2.0 .NET guide for more details. Please let us know if the issue is not resolved.

Regards,
Umesh, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages