Hello, I followed the *playlist* available on your youtube channel allowing
the *initialization* of one of the API, however when I want to *create an
account* according to the way you describe in the *documentation*, my
server *crashes* due to a *timeout*, the *function* used below:
def create_customer(token):
client = create_client(token)
manager_customer_id = bytes(****)
customer_service = client.get_service("CustomerService")
customer = client.get_type("Customer")
now = datetime.today().strftime("%Y%m%d %H%M%S")
customer.descriptive_name = f"Account created with CustomerService on
{now}"
customer.currency_code = "EUR"
customer.time_zone = "Europe/Paris"
try:
response = customer_service.create_customer_client(
customer_id=manager_customer_id,
customer_client=customer,
)
print(
f"Created customer with resource name
'{response.resource_name}' "
f"under manager account with ID '{manager_customer_id}'."
)
return response.resource_name
except GoogleAdsException as ex:
print(
f'Request with ID "{ex.request_id}" failed with status '
f'"{ex.error.code().name}" and includes the following errors:'
)
for error in ex.failure.errors:
print(f'\tError with message "{error.message}".')
if error.location:
for field_path_element in
error.location.field_path_elements:
print(f"\t\tOn field: {field_path_element.field_name}")
except Exception as e:
print(f"Unexpected error {e}")
return f"Unable to create customer: {e}"
*and the call:*@app.route("/create-customer", methods=["POST"])
@cross_origin()
def create_customer():
headers = request.headers
token = headers["token"]
result = create_customer(token)
return jsonify({"message": result})
How can i rectify this?
Thanks
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/9be38769-7e8e-4a06-9f38-1c54a84164edn%40googlegroups.com.