I get JSON data from the Yandex.Direct API, but when I try to parse it there is an error:
SyntaxError: Unterminated string literal (line 231, file "importJSON")
My code:
var jsondata = UrlFetchApp.fetch('https://api.direct.yandex.ru/v4/json/', options);
var contextText = jsondata.getContentText();
var object = JSON.parse(contextText);
I think that this problem may be caused by invisible symbols U+2028, U+2029 (http://timelessrepo.com/json-isnt-a-javascript-subset), but I can't find it in the result file.
Please share any suggestions.
UPDATE: I cannot post the resulting JSON here because it contains sensitive production data.
The error appears when using the method
http://api.yandex.ru/direct/doc/reference/GetBanners.xml - 1 request with 10 campaign_ids = [8388422,8396871,8409767,8409910,8409979,8434877,8434885,8434891,8435993,8446636];
If I use this method ten times with one campaign_id in the request, there is no such problem. It's very strange.