Google Ads API Cannot create linked customer with api v2

53 views
Skip to first unread message

Asaf Zinger

unread,
Jul 17, 2019, 6:53:57 AM7/17/19
to AdWords API and Google Ads API Forum
Hi,
I'm trying to create a new customer using the example from git:

I'm getting the following error:
TypeError: create_customer_client() missing 2 required positional arguments: 'email_address' and 'access_role'

(BTW, it is working just fine when switching to V1)

I tried to alter the code like this:
 
role = client.get_type('AccessRoleEnum').ADMIN
response
= customer_service.create_customer_client(mgr_id, customer, "ma...@gmail.com", role)

But now I'm getting this error:
 File <>/.local/share/virtualenvs/ml-googleapi-n6J6a0FH/lib/python3.7/site-packages/google/ads/google_ads/v2/services/customer_service_client.py", line 390, in create_customer_client
    access_role=access_role,
TypeError: Parameter to MergeFrom() must be instance of same class: expected google.protobuf.StringValue got str.


Can anyone know how to do it correctly?

Google Ads API Forum Advisor Prod

unread,
Jul 17, 2019, 3:50:26 PM7/17/19
to zing...@gmail.com, adwor...@googlegroups.com
Hi Asaf,

Thank you for bringing this to our attention! I'm the maintainer of the Python library and this appears to be a bug in the example that we need to fix. I've created an issue on the repository to track it, please see here: https://github.com/googleads/google-ads-python/issues/158

In the meantime you can manually edit the example so the two new parameters (email_address and access_role) described in this documentation are passed into the call to customer_service.create_customer_client.

Hope this helps, if you have any additional questions about this problem or the Python library please comment on the above issue or open a new issue.

Best,
Ben Karl, Google Ads API Team

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