MCC sub accounts creation error AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED

1,096 views
Skip to first unread message

g...@alpha9marketing.com

unread,
Oct 29, 2014, 11:08:11 AM10/29/14
to adwor...@googlegroups.com
Look the yaml file:

adwords:
  client_secret: 'HIDDEN SECRET'
  refresh_token: 'MY REFRESH TOKEN'
  user_agent: 'My UA'
  developer_token: 'MY DEV TOKEN'



I used to be able to create sub accounts (python code):

YAML_KEY = 'adwords'
# A list of values which must be provided to use AdWords.
REQUIRED_INIT_VALUES = ('user_agent', 'developer_token')
# A list of values which may optionally be provided when using AdWords.
OPTIONAL_INIT_VALUES = ('validate_only', 'partial_failure', 'client_customer_id', 'https_proxy')
yaml_path = '/home/kk/googleads.yaml'
kwargs = googleads.common.LoadFromStorage(
                    yaml_path, YAML_KEY, REQUIRED_INIT_VALUES,
                    OPTIONAL_INIT_VALUES)
client = adwords.AdWordsClient(**kwargs)
import random
rnum = random.randint(1, 10000)
acc_name = 'Test client %d' % rnum
currency, timezone = 'EUR', 'Europe/Berlin'
operations = [{
            'operator': 'ADD',
            'operand': {
              'name': acc_name,
              'currencyCode': currency,
              'dateTimeZone': timezone,
            }
        }]
managed_customer_service = client.GetService(
            'ManagedCustomerService', version='v201409')
accounts = managed_customer_service.mutate(operations)

I am getting the error:
WebFault: Server raised fault: '[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:'<null>']'

I am pretty sure the code above was working . In fact I have already created some accounts

Thanks

g...@alpha9marketing.com

unread,
Oct 31, 2014, 9:58:58 AM10/31/14
to adwor...@googlegroups.com
The Test MCC account allows only 9 test sub accounts to be created.

That was the problem.

In my message above I wrote:
WebFault: Server raised fault: '[AuthenticationError.CLIENT_CUSTOMER_ID_IS_REQUIRED @ ; trigger:'<null>']'

This errors happened because I did not include the MCC's customer id in the request.

Josh Radcliff (AdWords API Team)

unread,
Oct 31, 2014, 5:20:37 PM10/31/14
to adwor...@googlegroups.com
Hi,

Glad you were able to resolve this. Note that starting with v201409 you need to include the clientCustomerId SOAP header for all services except CustomerService (see the v201409 migration guide).

Cheers,
Josh, AdWords API Team
Reply all
Reply to author
Forward
0 new messages