How can I get client account id

111 views
Skip to first unread message

jianan wang

unread,
Nov 19, 2019, 8:29:17 AM11/19/19
to AdWords API and Google Ads API Forum

Hi,

I have the credentials of an MCC account and has some client account with it. But through the Oauth process, I can just get the MCC account's client id. So, how can I get all the accounts under an MCC through process? Thank you.

Best Regard,
Jianan Wang

Google Ads API Forum Advisor Prod

unread,
Nov 19, 2019, 11:46:00 AM11/19/19
to wangjia...@gmail.com, adwor...@googlegroups.com

Hi Jianan,

Thanks for reaching out. You could use the ManagedCustomerService.get() to retrieve the MCC account's client Id. This is a code example for you on how to use this service. Please let us know if you have any further concerns.

Thanks and regards,
Xiaoming, Google Ads API Team



ref:_00D1U1174p._5001UOCbvR:ref

jianan wang

unread,
Nov 21, 2019, 7:49:25 AM11/21/19
to AdWords API and Google Ads API Forum
Hi,

I don't have a customer's client id, how can I send an invitation to customer or link customer's account to my MCC account through the api or Oauth2 process?

Thanks,
Jianan Wang


在 2019年11月20日星期三 UTC+8上午12:46:00,adsapiforumadvisor写道:

Google Ads API Forum Advisor Prod

unread,
Nov 21, 2019, 3:10:43 PM11/21/19
to wangjia...@gmail.com, adwor...@googlegroups.com

Hi Jianan,

You could use the ManagedCustomerService.get() to retrieve the customer account ids if the customer accounts are already linked to the MCC account. If not, then you have to look up the customer account id through the Google Ads UI. If you would like to link any customer account to your MCC account via API you would need to use ManagedCustomerService.mutate() and inviteeEmail and inviteeRole in MangedCustomerOperation. Keep in mind that inviteeEmail and inviteeRole are accessible to whitelisted customers only. Please let us know if you have any further questions.



Thanks and regards,
Xiaoming, Google Ads API Team



ref:_00D1U1174p._5001UOCbvR:ref

jianan wang

unread,
Nov 22, 2019, 7:07:59 AM11/22/19
to AdWords API and Google Ads API Forum
Hi

I use these code to invite a customer, but it come's out the error below:
[RequestError.UNKNOWN @ operations[0].inviteeEmail; trigger:'wangjia...@gmail.com']

How can I fix the error?

$managedCustomerService = (new AdWordsServices())->get($session, ManagedCustomerService::class);

// Create a managed customer.
$customer = new ManagedCustomer();
$customer->setName('Account #' . uniqid());
$customer->setCurrencyCode('EUR');
$customer->setDateTimeZone('Europe/London');

// Create a managed customer operation and add it to the list.
$operations = [];
$operation = new ManagedCustomerOperation();
$operation->setOperator(Operator::ADD);
$operation->setOperand($customer);
$operation->setInviteeEmail('wangjia...@gmail.com');
$operation->setInviteeRole(AccessRole::STANDARD);

$operations[] = $operation;
// Create a managed customer on the server and print out some info
// about it.
$customer = $managedCustomerService->mutate($operations)->getValue()[0];
printf(
    "Account with customer ID %d was created.\n",
    $customer->getCustomerId()
);

Thanks and regards, 
Jianan Wang


在 2019年11月22日星期五 UTC+8上午4:10:43,adsapiforumadvisor写道:

Google Ads API Forum Advisor Prod

unread,
Nov 22, 2019, 2:41:13 PM11/22/19
to wangjia...@gmail.com, adwor...@googlegroups.com

Hi Jianan,

The inviteeEmail and inviteeRole fields are accessible to whitelisted customers only. Could you please send us your customer Id via Reply Privately to Author option for us to check whether it has been whitelisted for this feature?



Thanks and regards,
Xiaoming, Google Ads API Team



ref:_00D1U1174p._5001UOCbvR:ref

jianan wang

unread,
Nov 23, 2019, 5:36:24 AM11/23/19
to AdWords API and Google Ads API Forum

Hi,

I have replied you the customer id privately. If the customer isn't on the whitelist, what else I can do to let the customer associate with my MCC through api or Oauth2 process?

Thanks and regards,
Jianan Wang


在 2019年11月23日星期六 UTC+8上午3:41:13,adsapiforumadvisor写道:

Google Ads API Forum Advisor Prod

unread,
Nov 25, 2019, 11:16:14 AM11/25/19
to wangjia...@gmail.com, adwor...@googlegroups.com

Hi Jianan,

By further checking with your account I can confirm your account is not whitelisted for this feature. Currently there is no other way to associate the customer account with the MCC account via API if the MCC manager account is not directly whitelisted. Please let us know if you have any further questions.



Thanks and regards,
Xiaoming, Google Ads API Team



ref:_00D1U1174p._5001UOCbvR:ref

jianan wang

unread,
Nov 25, 2019, 11:55:39 PM11/25/19
to AdWords API and Google Ads API Forum

Hi,

So, how can my account become whitelisted?

Thanks,
Jianan Wang


在 2019年11月26日星期二 UTC+8上午12:16:14,adsapiforumadvisor写道:

Google Ads API Forum Advisor Prod

unread,
Nov 26, 2019, 10:12:19 AM11/26/19
to wangjia...@gmail.com, adwor...@googlegroups.com

Hi Jianan,

You could ask your account manager at Google to request if you could be added to the whitelist. Please let us know if you have any further questions.



Thanks and regards,
Xiaoming, Google Ads API Team



ref:_00D1U1174p._5001UOCbvR:ref
Reply all
Reply to author
Forward
0 new messages