Hello everyone, 

I am trying to fetch query results through HTTP/JSON Combination in Google 
Ads API. I am making the request from Google Apps Script. However, I am 
consistently getting an error code "UNEXPECTED_END_OF_QUERY" for all syntax 
of Query. Strangely, even when I delete the query statement, I get the same 
error. Can you please help me identify the cause of error and resolve the 
same? 

-----------------------------------CODE-----------------------------------------------------------------
var url = 
'https://googleads.googleapis.com/v2/customers/CUSTOMERID/googleAds:search'; 
var headers = { 'Authorization': 'Bearer '+ ACCESSTOKEN, 'developer-token': 
DEVELOPERTOKENKEY', 'contentType': 'application/json', }; data = { "query": 
"SELECT campaign.id, campaign.name FROM campaign ORDER BY campaign.id" };
var options = { 'headers':headers, 'method':'post', 
'muteHttpExceptions':true, "Parameters": data
};

var response = UrlFetchApp.fetch(url, options);
Logger.log(response.getContentText());

---------------------------------RESPONSE ERROR
---------------------------------------------------------------

{
"error": { "code": 400, "message": "Request contains an invalid argument.", 
"status": "INVALID_ARGUMENT", "details": [ { "@type": 
"type.googleapis.com/google.ads.googleads.v2.errors.GoogleAdsFailure", 
"errors": [ { "errorCode": { "queryError": "UNEXPECTED_END_OF_QUERY" }, 
"message": "Error in query: unexpected end of query." } ] } ] } } 

--------------------------------------------------------------------

Would appreciate help on this. Thanks

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/cfa4461f-ceb1-4ad1-8ff3-de03c914f55c%40googlegroups.com.

Reply via email to