How to get a whole list of client_customer_ids with MCC accounts using Ruby

52 views
Skip to first unread message

Ben Zhang

unread,
Dec 21, 2014, 8:54:17 PM12/21/14
to adwor...@googlegroups.com
We are using API to download ad performance reports for all our customers. The hierarchy is this:

One top level account has many MMC accounts, each of which has many customer accounts. So I have a client_id for the top level account, an client_id each for each MMC and many client_customer_ids, one for each end customer.

I am using this script: 

I tried to generate oauth access token in the yml file using the top account client_id and MCC client_id and then run get_account_hierarchy. I always ended up with the error

Message: [AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:'<null>']
Errors:
Error [1]:
field_path: 
trigger: <null>
error_string: AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED
api_error_type: AuthenticationError
reason: CLIENT_CUSTOMER_ID_IS_REQUIRED
xsi_type: AuthenticationError

Does anyone know why? Is this the right approach to get a whole list of client_customer_ids ?? My gut feeling is that I am filling up the yml file wrong. 

Danial Klimkin

unread,
Dec 22, 2014, 8:26:30 AM12/22/14
to adwor...@googlegroups.com
Hello Ben,


Looks like this example was not updated. ClientCustomerId is a required field now.

You can resolve the issue by changing line

graph = adwords.use_mcc() {managed_customer_srv.get(selector)}

to

graph = managed_customer_srv.get(selector)

Also, would you mind logging a bug on the tracker regarding this issue?




-Danial, AdWords API Team.
Reply all
Reply to author
Forward
0 new messages