Error while using Google Ads API

83 views
Skip to first unread message

Sergey Kharchenko

unread,
Jan 21, 2021, 6:56:43 AM1/21/21
to AdWords API and Google Ads API Forum
Hello! 

We are currently using Google Ads Api, and we are trying to create AdGroupAd object.

Unfortunately, we get the next error - https://prnt.sc/xd7pge

The request is:


Body:
{
    "operations": [
        {
            "create": {
                "ad": {
                    "name": "TestAdName"
                },
                "adGroup": "customers/2794540772/adGroups/115036497545",
                "status": "PAUSED"
            }
        }
    ]
}

Headers and developer-token are correct.

Can you please give us more details on how to properly use Google Ads API?

What does this exception message mean?

Regards,
Sergei

Google Ads API Forum Advisor Prod

unread,
Jan 21, 2021, 9:35:22 PM1/21/21
to sergei.k...@gmail.com, adwor...@googlegroups.com
Hi Sergei,

So our team could get additional context about the issue, could you provide the complete request and response logs, along with the request ID, that was generated when the error occurred?

If you haven't 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.

You may then send the requested details using the Reply privately to author option.

Best regards,

Google Logo
Peter Laurence Napa Oliquino
Google Ads API Team
 


ref:_00D1U1174p._5004Q2B29KU:ref

Sergei Kharchenko

unread,
Feb 8, 2021, 5:15:39 AM2/8/21
to AdWords API and Google Ads API Forum
Hi!

We don't use any of existing client libraries of Google Ads Api.
In our example, we use a direct Web request to https://googleads.googleapis.com/v5/.

Body:
{
"operations": [
{
"create": {
"ad": {
"name": "TestAdName"
},
"adGroup": "customers/2794540772/adGroups/115036497545",
"status": "PAUSED"
}
}
]
}

The response - https://prnt.sc/xd7pge

Regards,
Sergei

Steve Wilcox

unread,
Feb 8, 2021, 10:16:57 AM2/8/21
to AdWords API and Google Ads API Forum
Sergei,

We are also using raw web requests.  

Our current code creates the ad thru the "customers/<customerid>/ads/" end point, rather than "adGroupAds"
Also, I'm not sure which of the "ads" fields are optional, but you might need more than just the name.

Good luck!

Jeff Moore

unread,
Feb 8, 2021, 11:15:42 AM2/8/21
to AdWords API and Google Ads API Forum
Here is an example call that will work, in case it helps. It creates an expanded text ad
/v6/customers/CUSTOMER_NUMBER/adGroupAds:mutate
{
  "operations": [
    {
    "create": {
        "ad": {
            "finalUrls": ["http://www.test.com"],
            "expandedTextAd": {
            "description": "test",
            "headlinePart1": "RESPONSIVE_SEARCH_AD",
            "headlinePart2": "par 2",
            "path1": "New Ad 1",
            "path2": "test 2"
          }
          },
        "adGroup": "customers/CUSTOMER_ID/adGroups/AD_GROUP_ID",
        "status": "PAUSED"
      }
    }
  ]
}

Google Ads API Forum Advisor Prod

unread,
Feb 9, 2021, 12:53:56 AM2/9/21
to sergei...@gmail.com, adwor...@googlegroups.com
Hi Sergei,

Apart from the information provided in the thread, you may also check out these documentation on how you can correctly construct your requests :

REST Mutate methods
REST Design 

You may also opt to use the v6 and refer to the Discovery Document for V6 guide. I hope this helps. 
Reply all
Reply to author
Forward
0 new messages