Given just a GoogleAds client, and a customerid, you determine 
logincustomerid (the id of the MCC containing the requested customerid):

First, call CustomerService.ListAccessibleCustomers(). This returns a list 
of MCCs that the user can access.
Then, for each MCC returned, request a report on customer_client. In the 
results you check whether your requested account is returned - if you find 
it, you've got your logincustomerid.
If none of the MCCs knows this customerid, then the user does not have 
access to that account.

It's painful to go through every MCC, but, currently nobody can have 
hundreds of MCCs - so it shouldn't take too long.

Hope this helps.

On Sunday, April 23, 2023 at 2:58:36 PM UTC+2 林灿 wrote:

> Hi,
>      The managerName cannot be obtained according to the above method. My 
> application scenario is that a manager account authorizes his advertising 
> account (*customerId*) to my account. At this time, I only know the 
> customerId. How should I obtain the manager account id and manager account 
> name corresponding to this customerId by java api?
>
> On Thursday, April 20, 2023 at 11:54:23 PM UTC+8 Google Ads API Forum 
> Advisor wrote:
>
>> Hi 林灿, 
>>
>> Thanks for reaching out to the Google Ads API Team. I hope you are doing 
>> well today.
>>
>> With regards to your concern, upon checking there is a duplicate email 
>> thread with the subject titled “How to get Manager Info?”. We already 
>> responded on that thread, see below for reference.
>>
>> *Assuming that you’re following the** List Accessible Accounts** guide, 
>> any account numbers can be accessed directly without a login customer Id 
>> header so you can pull a customer report for each of the CID/MCCID's and 
>> you can get the name from the **customer.descriptive_name field*
>>
>> *. Links included in the context above:*
>>
>>    - *List Accessible Accounts guide - *
>>    
>> *https://developers.google.com/google-ads/api/docs/account-management/listing-accounts*
>>  
>>    
>> <https://developers.google.com/google-ads/api/docs/account-management/listing-accounts>
>>  
>>    - *login customer Id header - *
>>    
>> *https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid*
>>  
>>    
>> <https://developers.google.com/google-ads/api/docs/concepts/call-structure#cid>
>>  
>>    - *customer report - *
>>    *https://developers.google.com/google-ads/api/fields/v13/customer* 
>>    <https://developers.google.com/google-ads/api/fields/v13/customer> 
>>    - *customer.descriptive_name - *
>>    
>> *https://developers.google.com/google-ads/api/fields/v13/customer#customer.descriptive_name*
>>  
>>    
>> <https://developers.google.com/google-ads/api/fields/v13/customer#customer.descriptive_name>
>>  
>>
>>
>> *  However, if I misunderstood your concern and you're looking for 
>> different data, then please share with us the UI screenshot of the data 
>> that you're expecting to retrieve so that we can assist you accordingly. 
>> You may send it via 'Reply privately to author' option. If this option is 
>> not available, then send it instead on this email 
>> address googleadsa...@google.com.*
>>
>> In line with this, please avoid creating multiple threads with the same 
>> topic. For now we will continue the discussion on that email thread, for 
>> better tracking of updates.
>>
>> Have a great day.
>>
>> Regards,
>> [image: Google Logo] Google Ads API Team 
>>
>> ref:_00D1U1174p._5004Q2koUHo:ref
>>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/bde8fe34-205c-4c89-8a80-584ac1961365n%40googlegroups.com.

Reply via email to