Testing Account Campaign Create issue (Google ads)

91 views
Skip to first unread message

Sudarshan Nivrutti Dhatrak

unread,
Aug 19, 2022, 12:02:46 AM8/19/22
to Google Ads API and AdWords API Forum
Hello,
I have just created a test manager account for google ads and then created a client from the same account. I am trying to access the create campaign Api, but getting invalid json error in response. I am attaching the request and response.

Request :

"options": { "method": "POST", "uri": "https://googleads.googleapis.com/v11/customers/campaigns:mutate", "qs": {}, "headers": { "Accept": "application/json", "Authorization": "Bearer (My Accesstokn)", "Host": "googleads.googleapis.com", "Content-Type": "application/json", "developer-token": "(developer token from manager account(test access))" }, "body": { "operations": [ { "create": { "name": "An example campaign", "status": "PAUSED", "campaignBudget": "customers/campaignBudgets/12qw", "advertisingChannelType": "SEARCH", "networkSettings": { "targetGoogleSearch": true, "targetSearchNetwork": true, "targetContentNetwork": true, "targetPartnerSearchNetwork": false }, "target_spend": {} } } ] }, "json": true, "simple": true, "resolveWithFullResponse": false, "transform2xxOnly": false },

Response :

  "response": { "statusCode": 400, "body": { "error": { "code": 400, "message": "Invalid JSON payload received. Unknown name \"operations\": Cannot find field.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.rpc.BadRequest", "fieldViolations": [ { "description": "Invalid JSON payload received. Unknown name \"operations\": Cannot find field." } ] } ] } }, "headers": { "vary": "X-Origin, Referer, Origin,Accept-Encoding", "content-type": "application/json; charset=UTF-8", "date": "Thu, 18 Aug 2022 13:07:04 GMT", "server": "ESF", "cache-control": "private", "x-xss-protection": "0", "x-frame-options": "SAMEORIGIN", "x-content-type-options": "nosniff", "alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-Q050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"", "accept-ranges": "none", "connection": "close", "transfer-encoding": "chunked" },

Please Help me with the issue.
Thanks and regards,
Sudarshan

Google Ads API Forum Advisor

unread,
Aug 19, 2022, 6:34:43 AM8/19/22
to suda...@appypiellp.com, adwor...@googlegroups.com
Hi Sudarshan,

Thank you for reaching us out. I am Sherwin from Google Ads API support team. I hope that you are doing well today.

Upon checking on the response logs, we notice that the Invalid JSON payload received is caused by an Unknown name \"operations\": Cannot find field. With this, what we can do is to advise you to follow this guide in creating campaigns depending on the client library that you are using. Add to that if you are still receiving the error, please provide us the complete request and response logs with request ID and request header generated on your end? You can provide it via Reply privately to author option. If this option is not available, then send it instead on this email address googleadsa...@google.com. If you haven't enabled the logging yet, logging can be enabled by navigating to the Client libraries > Your client library (ex. Java) > Logging documentation, which you can access from this link.

Kind regards,
Google Logo
Sherwin Vincent
Google Ads API Team
 


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