Got exception [AuthorizationError.USER_PERMISSION_DENIED] when trying accept invitation to link account

89 views
Skip to first unread message

Adam Nowak

unread,
Aug 13, 2015, 9:43:29 AM8/13/15
to AdWords API Forum
Hello. I'm using AdWords API v201506 in .NET. I would like to send invitation from ACCOUNT_MANAGER to ACCOUNT_CLIENT - I'm using belowe code and it works:

AdWordsUser user = new AdWordsUser();
(user.Config as AdWordsAppConfig).ClientCustomerId = "ACCOUNT_MANAGER_ID";
ManagedCustomerService managedCustumer = (ManagedCustomerService)user.GetService(AdWordsService.v201506.ManagedCustomerService);

LinkOperation linkOp = new LinkOperation();
ManagedCustomerLink link = new ManagedCustomerLink();
link
.clientCustomerId = ACCOUNT_CLIENT_ID;
link
.linkStatus = LinkStatus.PENDING;
link
.managerCustomerId = ACCOUNT_MANAGER_ID;
linkOp
.operand = link;
linkOp.@operator = Operator.ADD;
managedCustumer
.mutateLink(new LinkOperation[] { linkOp });

I signin as ACCOUNT_CLIENT to adwords account by web browser and I find new invitation - so it's working.
Next step is acceptation this invitation. So I', trying this:

AdWordsUser user = new AdWordsUser();
(user.Config as AdWordsAppConfig).ClientCustomerId = "ACCOUNT_CLIENT_ID";
ManagedCustomerService managedCustumer = (ManagedCustomerService)user.GetService(AdWordsService.v201506.ManagedCustomerService);
LinkOperation linkOp = new LinkOperation();
ManagedCustomerLink link = new ManagedCustomerLink();
link
.clientCustomerId = ACCOUNT_CLIENT_ID;
link
.linkStatus = LinkStatus.ACTIVE;
link
.managerCustomerId = ACCOUNT_MANAGER_ID;
linkOp
.operand = link;
linkOp.@operator = Operator.SET;
managedCustumer
.mutateLink(new LinkOperation[] { linkOp });


But it's not working - I still get exception: [AuthorizationError.USER_PERMISSION_DENIED @ ; trigger:'<null>'] for:

managedCustumer.mutateLink(new LinkOperation[] { linkOp });

According to documentation it's mean that "User doesn't have permission to access customer." Why I can't get access? (In code: )I set CLIENT id for AdWords user, accept invitation as CLIENT and point MANAGER as 'managerCustomer'. 

Josh Radcliff (AdWords API Team)

unread,
Aug 14, 2015, 9:38:01 AM8/14/15
to AdWords API Forum
Hi,

In the step where you are trying to set the link to ACTIVE, are you using OAuth credentials for the AdWords account (ACCOUNT_CLIENT_ID)? That request will only work if the credentials are for a user who already has access to ACCOUNT_CLIENT_ID.

It sounds like you may be using the ACCOUNT_MANAGER_ID credentials for both calls, but that won't work at that point because users with access to the MCC won't yet have access to the client account.

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages