Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 应用程序脚本:UrlShortener.newUrl().setLongUrl()不再工作_Google Apps Script - Fatal编程技术网

Google apps script 应用程序脚本:UrlShortener.newUrl().setLongUrl()不再工作

Google apps script 应用程序脚本:UrlShortener.newUrl().setLongUrl()不再工作,google-apps-script,Google Apps Script,以下代码(直接从Google Apps脚本网站的UrlShortener文档页面复制)在6月17日(更新时)停止工作 在本例中,toShorten一直在返回“未定义”。是。UrlShortner APi已更改。对您的代码进行此小更改 var toShorten = UrlShortener.newUrl(); toShorten.setLongUrl("http://example.com"); var shortened = UrlShortener.Url.insert(toShorten)

以下代码(直接从Google Apps脚本网站的UrlShortener文档页面复制)在6月17日(更新时)停止工作


在本例中,toShorten一直在返回“未定义”。

是。UrlShortner APi已更改。对您的代码进行此小更改

var toShorten = UrlShortener.newUrl();
toShorten.setLongUrl("http://example.com");
var shortened = UrlShortener.Url.insert(toShorten);

看看哪一个谈论了完全相同的问题

是的。它已经改变了。见[相关答案][1]。[1]:
var toShorten = UrlShortener.newUrl();
toShorten.setLongUrl("http://example.com");
var shortened = UrlShortener.Url.insert(toShorten);