UNEXPECTED_END_OF_QUERY - Error

427 views
Skip to first unread message

Giuseppe Pandolfino

unread,
Dec 14, 2021, 5:34:13 AM12/14/21
to AdWords API and Google Ads API Forum

Hi, I am trying to use REST Google Ads API (https://developers.google.com/google-ads/api/rest/design/overview).

I am testing using Postman.

I need to use the following query:SELECT customer.id, segments.date, campaign.id, ad_group.id, segments.device, metrics.impressions, metrics.clicks, metrics.cost_micros, metrics.conversions, metrics.top_impression_percentage FROM ad_group WHERE segments.date BETWEEN '2021-11-01' AND '2021-11-30' LIMIT 99999

to obtain my result.

I've already checked with the query validator (https://developers.google.com/google-ads/api/fields/v9/query_validator) and it is OK. 


I set:

POST https://googleads.googleapis.com/v9/customers/XXXXXX/googleAds:search

where XXXXX is my customer.


In the header, I set:

  • Content-Type application/json
  • developer-token = my developer token
  • query = previous query
  • returnTotalResultsCount = true


each time I try it, I always receive :


{

    "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": {

                            "queryError": "UNEXPECTED_END_OF_QUERY"

                        },

                        "message": "Error in query: unexpected end of query."

                    }

                ],

                "requestId": "yhn8LnBAnBaJtbmyskNpiQ"

            }

        ]

    }

}


Where is my error? 

Can you help me , please ?

thank you

Google Ads API Forum Advisor

unread,
Dec 14, 2021, 8:20:57 PM12/14/21
to giuseppe....@motork.io, adwor...@googlegroups.com
Hi Giuseppe,

Thank you for posting your concern.

To investigate the issue, could you provide the actual API request and request header that you've executed and the complete response logs with request ID 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.

Regards,
Google Logo
Ernie John Blanca Tacata
Google Ads API Team
 


ref:_00D1U1174p._5004Q2TKyV0:ref
Message has been deleted

Google Ads API Forum Advisor

unread,
Dec 17, 2021, 12:46:09 PM12/17/21
to chirag....@gmail.com, adwor...@googlegroups.com

Hello there,

Thanks for getting back to us. I am just wondering if your issue is related to the selectable_segment_fields while using the ad_group resource.

As Ernie mentioned in the previous response, could you please provide the complete request and response logs with request-id for us to investigate the issue further. Kindly use the Reply privately to the author option while sharing the details.

Regards,

Reminder: Share your feedback about the Google Ads (AdWords) API! Take the 2021 Google Ads API and AdWords API Annual Survey

Google Logo
Jakeia Sabrina
Google Ads API Team
 

ref:_00D1U1174p._5004Q2TKyV0:ref
Message has been deleted

Google Ads API Forum Advisor

unread,
Jan 6, 2022, 1:37:58 PM1/6/22
to giuseppe....@motork.io, adwor...@googlegroups.com

Hello Giuseppe,

Glad to know that the issue has been resolved. Please let us know if we can help with anything else.

Regards,

Reply all
Reply to author
Forward
0 new messages