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:
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
|
||||||
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
![]() |
|
||||
Hello Giuseppe,
Glad to know that the issue has been resolved. Please let us know if we can help with anything else.
Regards,