I am trying to create a Google Spreadsheet function to shorten URLs.
I have this code :
function shortenUrl(_longurl) {
var url = UrlShortener.Url.insert({longUrl: _longurl});
Logger.log('Shortened URL is "%s".', url.id);
}
function testMinifyGoogl() {
longurl = 'https://maps.google.com/maps';
shortenUrl(longurl);
}
I have several Google login IDs for testing purposes. I experience the same problem repeating the above with two different ones.
In all cases I get back : "Access Not Configured. Please use Google Developers Console to activate the API for your project. (line 7, file "Code")"
As reference I am reading : https://developers.google.com/apps-script/advanced/url-shortener. After reading up on access requirements, I went to [Resources] >> [Advanced Google services] in my script editor and activated URL Shortener API. I followed the link from there to "Google Developers Console" and enabled the same API there.
Am I doing something wrong or is the service broken?
I do not think I require an access key. I am logged in to Google already, in order to use the spreadsheet! Also, when I run the script I do get a request for permission to access my short urls!