Invalid Argument Error

721 views
Skip to first unread message

Ezinete de Oliveira Gomes

unread,
Jan 30, 2014, 2:05:02 PM1/30/14
to adwords...@googlegroups.com
Hello! 

I need help with an error that has occurred with some frequency in the scripts that I developed. 

I believe it is something related to UrlFetchApp.fetch() service. 
In some moments when I need to take a post in a URL the "com.br" text is replaced by "<?>" and this causes the invalid argument error interrupting the execution of the script, for example: 

The URL "http://www.mysite.com.br/product" just returning "http://www.mysite.<?>/ Product." 

What could be causing this problem? 

Thanks! 
Ezinete

Anash Oommen

unread,
Jan 30, 2014, 4:08:33 PM1/30/14
to adwords...@googlegroups.com
Hi Ezinete,

I wonder if that's a bad case of url escaping. You could try using the flags for UrlFetchApp to disable escaping. See https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app#fetch(String,Object) for all the supported options.

Cheers,
Anash P. Oommen,
AdWords Scripts Team

Ezinete de Oliveira Gomes

unread,
Feb 4, 2014, 10:41:44 AM2/4/14
to adwords...@googlegroups.com
Hi Anash, 

I tried using the flag fetch (url, params) method to disable the UrlFetchApp scaping, as in the example below: 

   var = fetchOptions 
       {
         "muteHttpExceptions": true, 
         "escaping": false 
       }; 

But invalid argument error continues. 

Is there another solution? 

Thanks for your help! 

Att, 
Ezinete

Ezinete de Oliveira Gomes

unread,
Feb 5, 2014, 9:17:11 AM2/5/14
to adwords...@googlegroups.com
Hi Anash, 

The flag fetch (url, params) to disable the UrlFetchApp scaping method did not work. 

But I managed to fix the error using encodeURI () and encodeURIComponent () javascript. 

Thanks for your help! 

Att, 
Ezinete


Reply all
Reply to author
Forward
0 new messages