Error with create Customer Client Create and Update on google Ads API

182 views
Skip to first unread message

Samantha Kapai

unread,
Aug 28, 2022, 11:06:11 AM8/28/22
to Google Ads API and AdWords API Forum
Hello

I am trying to create a customerClient and do an update but i get an error....Below is the my request for create and update respectively. 

Client Customer Client

Request
{
"customerClient": {
"customer": {"name":"test", "timeZone":"America/New York", "descriptiveName": "Test123"} },
"validateOnly":false,
"emailAddress": ""
}

URL: 

Response:
{"googleAdsError":"map[code:400 details:[map[@type:type.googleapis.com/google.ads.googleads.v11.errors.GoogleAdsFailure errors:[map[errorCode:map[requestError:REQUIRED_FIELD_MISSING] message:Field 'customer' is required for 'CREATE' operation.]] requestId:13sq-Hq1fVHcv6-9pIck0w]] message:Request contains an invalid argument. status:INVALID_ARGUMENT]","message":"google ads error","severity":"ERROR","timestamp":"2022-08-28T14:56:49.737499000"}


Update Customer name
Request:

{
"operations": [
{
"update": {
"name": "SojernMCCAcc",
},
"updateMask": "name"
}
],
}


Response: 
{"googleAdsError":"map[code:400 details:[map[@type:type.googleapis.com/google.ads.googleads.v11.errors.GoogleAdsFailure errors:[map[errorCode:map[requestError:OPERATION_REQUIRED] location:map[fieldPathElements:[map[fieldName:operation]]] message:Mutate operations must have 'create', 'update', or 'remove' specified.]] requestId:VlB-QuSOAFP5XzazK3GJDg]] message:Request contains an invalid argument. status:INVALID_ARGUMENT]","message":"google ads error","severity":"ERROR","timestamp":"2022-08-28T14:24:58.720427000"}

Could you please advise? The requests in both cases seem accurate. 

Regards
Samantha



Google Ads API Forum Advisor

unread,
Aug 29, 2022, 2:52:08 PM8/29/22
to samanth...@sojern.com, adwor...@googlegroups.com
Hi Samantha,

For customers.createCustomerClient the following 'body' works:
 "customerClient": {
"descriptiveName": "Test123",
     "currencyCode": "USD",
      "timeZone": "America/New_York"
  },

Note that it's "New_York" and there is no "name" field. I wasn't able to recreate your error and there's also no "create" operation.

For the "update" with :mutate, here is a valid 'body':

"operation": {
    "update": {
"resourceName": "customers/1234567890",
     "descriptiveName": "SojernMCCAcc",
  },
  "updateMask": "descriptiveName"

  },

It appears that in both calls you are referencing the unavailable field "name".

Regards,

Google Logo
Aryeh
Google Ads API Team
 


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