Question on ...\mcm\ManagedCustomerPage Object

35 views
Skip to first unread message

Tim Johnson

unread,
Sep 10, 2017, 10:37:01 PM9/10/17
to AdWords API Forum
So I am looking to find all campaigns tied to a refresh token that i received. Part of my program involves receiving the aforementioned object from the Adwords API.  From this object, I am looking to grab every clientID, under that refresh token, which can then contain campaigns...

Right now I am cycling through all  [links:protected]=>"clientCustomerId:protected" values...  Can you confirm that this is a correct methodology for achieving my goal?  Will there be any client ID's associated with the user that will not be covered in that key/value paid?

Thanks,
Tim

Peter Oliquino

unread,
Sep 11, 2017, 1:06:07 AM9/11/17
to AdWords API Forum
Hi Tim,

I'm afraid that there is currently no way to retrieve account(s) information using only a refreshToken or any of the OAuth2 credentials. If you wish to retrieve the list of clients under an MCC account, you may use the ManagedCustomerService.get and refer to the GetAccountHierarchy example (other languages are also available in the link). For this example, you will need to specify the MCC account ID as the value for the clientCustomerId field in your properties/configuration file. I hope this has been helpful.

Best regards,
Peter
AdWords API Team

Tim Johnson

unread,
Sep 11, 2017, 1:21:55 AM9/11/17
to AdWords API Forum
Hi Peter,

Thank you so much for the prompt response.  Fair enough, thanks for the heads up.

On the second question, the value of the "clientCustomerId:protected" key is the account that holds the campaigns, correct?  It never is a MCC account ID that don't "directly" have campaigns, do they?  That is what the "managerCustomerId" key is for, correct?

Thanks again for the help.

Tim

Peter Oliquino

unread,
Sep 11, 2017, 1:47:19 AM9/11/17
to AdWords API Forum
Hi Tim,

My apologies if I missed out on your second question. The "clientCustomerId" object as seen in this example pertains to the child or client accounts that contains the campaigns, ad groups, ads, keywords, etc. 

However, in the scenario that you also have another manager account directly under your MCC then I would recommend that you also use the CanManageClients = False, to filter only those accounts that are at the client level (account IDs which has the campaigns, etc.).

Vincent Racaza (AdWords API Team)

unread,
Sep 11, 2017, 10:49:20 PM9/11/17
to AdWords API Forum
Hi Tim,

If you want to get the clientCustomerIds associated to your refresh token (or basically, to your OAuth credentials), you can run the getCustomers() method of CustomerService. You don't need to set your clientCustomerId in the property file in running this method. And if you do this, all clientCustomerIds (and its information) that is being linked to your OAuth credentials will be returned. If you manually set the clientCustomerId in the property file and you run this method, only the details of the specific client customer will be returned.

Let me know if this helps.

Thanks,
Vincent
AdWords API Team
Reply all
Reply to author
Forward
0 new messages