Hi,

I have 2 mcc test accounts M1 and M2, M2 have 1 client account C2.
I want link C2 to M1, here is my step: 
Step 1: Use Google Sign In 
"https://developers.google.com/identity/sign-in/web/sign-in"; 
login account M2 to get Access token 
(googleUser.getAuthResponse().access_token)

Step 2: Follow this doc to link 
account: 
https://developers.google.com/google-ads/api/docs/account-management/linking-manager-accounts?hl=en

I got stuck when Accept the link using the client account.

here is my java code to accept:

AccessToken accessToken = new AccessToken(*Token from Step 1*, new 
Date(expireTime));
Credentials credentials = new GoogleCredentials(accessToken);
GoogleAdsClient client = GoogleAdsClient.newBuilder()
.setCredentials(credentials)
.setDeveloperToken(developerToken)
.setLoginCustomerId(*M2 customer Id*)
.build();

CustomerManagerLinkOperation.Builder managerLinkOp = 
CustomerManagerLinkOperation.newBuilder();
managerLinkOp
.getUpdateBuilder()
.setResourceName(
ResourceNames.customerManagerLink(*C2 customer Id*, *M1 customer Id*, 
managerLinkId))
.setStatus(ManagerLinkStatusEnum.ManagerLinkStatus.ACTIVE);

managerLinkOp.setUpdateMask(FieldMasks.allSetFieldsOf
(managerLinkOp.getUpdate()));

acceptService.mutateCustomerManagerLink(String.valueOf(*C2 customer Id*), 
Collections.singletonList(managerLinkOp.build()));

but it return error:
[error_code {
  authorization_error: USER_PERMISSION_DENIED
}
message: "User doesn\'t have permission to access customer. Note: If 
you\'re accessing a client customer, the manager\'s customer id must be set 
in the \'login-customer-id\' header. See 
https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid";
]

do I miss anything ?
 

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/c0af4d1d-9cf7-425b-a00b-b046657c4cf3n%40googlegroups.com.

Reply via email to