Hi @all,

I am confused as to how to add type enum in my json payload. I am fllowing 
this 
documentation: 
https://developers.google.com/google-ads/api/rest/reference/rest/v9/customers.customerNegativeCriteria?hl=en#CustomerNegativeCriterion

Task add ip block in customer negative criterian. 
Code: 
data = {
"customer_id": "752345",
"operations": [
{
"create": {
"resourceName": "customers/752345/customerNegativeCriteria/1523254697",
"type": "IP_BLOCK",
}
}
],
}


head = {
"Authorization": "Bearer ya29.A0A",
"Content-Type": "application/json",
"developer-token": "tp5w",
"login-customer-id": "752345",
}

response = requests.post(
"https://googleads.googleapis.com/v9/customers/752345/customerNegativeCriteria:mutate";,
json=data,
headers=head,
)

print(response.json())

error: {'error': {'code': 400, 'message': 'Request contains an invalid 
argument.', 'status': 'INVALID_ARGUMENT', 'details': [{'@type': 
'type.googleapis.com/google.ads.googleads.v9.errors.GoogleAdsFailure', 
'errors': [{'errorCode': {'fieldError': 'REQUIRED'}, 'message': 'The 
required field was not present.', 'location': {'fieldPathElements': 
[{'fieldName': 'operations', 'index': 0}]}}], 'requestId': 
'UKlHAbZ4m971g23Kt0TxOg'}]}

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
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 adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/413624d2-a66d-42dd-8b8d-32e1742b9fabn%40googlegroups.com.
  • cu... Ayodhya Joshi
    • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum

Reply via email to