Q:

Has the Url Shortener in Google Apps Script changed?

I've been using this simple function to create shortened links in Google Apps Script.  It's been working for the past few months but stopped working few days ago.  Has there been a change?
  function getShortenedUrl(url){   

      var longUrl = UrlShortener.newUrl()
      .setLongUrl(url);

      var shortUrl = UrlShortener.Url.insert(longUrl);

      return shortUrl.getId();
}

A:

Yes. It has. I figured it out the hard way. Just make a small change for it to work 
function getShortenedUrl(url){   

      var longUrl = UrlShortener.newUrl();
      longUrl.setLongUrl(url);

      var shortUrl = UrlShortener.Url.insert(longUrl);

      return shortUrl.getId();
}

