Hi,

You wrote
* To check whether 'b' is linked, I checked 'b' 's customer_manager_link, 
the results is empty *
and the question is of course how you checked that.

As far as I know, given a customer_id, the API offers no method to find out 
the managers of that account.
The way to go is to run "customer_client" report of the intended manager - 
in your case, manager A. For instance
SELECT
    customer_client.status,
    customer_client.id
FROM customer_client
WHERE customer_client.id = b

Run this under manager A, then check whether something is returned. Note: 
In v9 field 'status' does not exist and the report only lists active 
accounts. (And yes, that may explain why your check failed: the account 
wasn't active... From v10 on, disabled accounts are also returned.)


A different approach is just to ask a report (any report!) for that account 
with LoginCustomerId set to the intended manager - in your case that would 
be A. When you get an error, check the error: if it came because of no 
access then you can send the link request.



On Thursday, August 18, 2022 at 10:30:01 PM UTC+2 lsy wrote:

> Hello,
>
> I have a mangager account 'A' under one user, a manager accout 'B', and 
> 'B' s client account 'b' under another user. 
> My application needs to check whether an account is linked to 'A', if not, 
> send a link request. 
>
> I already linked 'B' to 'A', and now I want to deal with client account 
> 'b'. To check whether 'b' is linked, I checked 'b' 's 
> customer_manager_link, the results is empty, I also checked 'A' 's 
> customer_client_link, the results does not include 'b'.  When I use:
>
> customer_client_link_service.mutate_customer_client_link(customer_id=manager_customer_id,
>  
> operation=client_link_operation)
>
> to create customer_client_link between 'b' and 'A', I got the following 
> error:
> error_code {
>     manager_link_error: ALREADY_MANAGED_IN_HIERARCHY
>   }
>   message: "Client is already managed in hierarchy."
>
> With this situation, how can I know 'b' is already linked and then I will 
> not send link request?
>
> Thanks,
> Shiying 
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 
"Google Ads API and AdWords 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/e0a7af5c-47cf-4a73-af06-70858d26dae1n%40googlegroups.com.

Reply via email to